Created
June 27, 2016 12:54
-
-
Save skellock/d12dcc21b253cdc11f7c9ad9d72622d4 to your computer and use it in GitHub Desktop.
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
const INITIAL_STATE = { value: 0 } | |
// do something important & significant | |
const increment = (state, action) => ({ value: state.value + 1 }) | |
// our reducer | |
export default (state = INITIAL_STATE, action) => { | |
switch (action.type) { | |
case 'INCREMENT': return increment(state, action) | |
default: return state | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment