Last active
October 28, 2016 19:20
-
-
Save SeeThruHead/d66774c7a4d9c0bb4de063d2376ae6aa to your computer and use it in GitHub Desktop.
This file contains 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 { INCREMENT_COUNTER, DECREMENT_COUNTER } from '../constants/ActionTypes'; | |
export default (state = 0, action) => ({ | |
[actions.increment]: (state )=> state + 1, | |
[actions.decrement]: (state) => state - 1, | |
default: state => state | |
}[action.type || 'default'](state, action.payload)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment