Skip to content

Instantly share code, notes, and snippets.

@SeeThruHead
Last active October 28, 2016 19:20
Show Gist options
  • Save SeeThruHead/d66774c7a4d9c0bb4de063d2376ae6aa to your computer and use it in GitHub Desktop.
Save SeeThruHead/d66774c7a4d9c0bb4de063d2376ae6aa to your computer and use it in GitHub Desktop.
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