This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| ####################################################### | |
| # UNIX TREE # | |
| # Version: 2.3 # | |
| # File: ~/apps/tree/tree.sh # | |
| # # | |
| # Displays Structure of Directory Hierarchy # | |
| # ------------------------------------------------- # | |
| # This tiny script uses "ls", "grep", and "sed" # | |
| # in a single command to show the nesting of # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { Component } from 'react' | |
| export default class Counter extends Component { | |
| increment = () => { | |
| this.props.dispatch({ type: 'INCREMENT' }); | |
| } | |
| decrement = () => { | |
| this.props.dispatch({ type: 'DECREMENT' }); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function brokenReducer(state = initialState, action) { | |
| switch(action.type) { | |
| case 'INCREMENT': | |
| // NO! BAD: this is changing state! | |
| state.count++; | |
| return state; | |
| case 'DECREMENT': | |
| // NO! BAD: this is changing state too! | |
| state.count--; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react' | |
| import { Provider } from 'react-redux' | |
| import { createStore } from 'redux' | |
| import CounterContainer from './Counter.container' | |
| const initialState = { | |
| count: 0 | |
| } | |
| function reducer(state = initialState, action) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react' | |
| import { Provider } from 'react-redux' | |
| import { createStore } from 'redux' | |
| import CounterContainer from './Counter.container' | |
| const initialState = { | |
| count: 0 | |
| }; | |
| function reducer(state = initialState, action) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react' | |
| import { Provider } from 'react-redux' | |
| import { createStore } from 'redux' | |
| import CounterContainer from './Counter.container' | |
| const initialState = { | |
| count: 0 | |
| }; | |
| function reducer(state = initialState, action) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react' | |
| import { Provider } from 'react-redux' | |
| import { createStore } from 'redux' | |
| import CounterContainer from './Counter.container' | |
| function reducer(state, action) { | |
| return { | |
| count: 42 | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react' | |
| import { Provider } from 'react-redux' | |
| import { createStore } from 'redux' | |
| import CounterContainer from './Counter.container' | |
| function reducer() { | |
| return { | |
| count: 42 | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react' | |
| import { Provider } from 'react-redux' | |
| import { createStore } from 'redux' | |
| import CounterContainer from './Counter.container' | |
| function reducer() {} | |
| const store = createStore(reducer) | |
| const App = () => ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Provider } from 'react-redux'; | |
| ... | |
| const App = () => ( | |
| <Provider> | |
| <CounterContainer /> | |
| </Provider> | |
| ); |