Skip to content

Instantly share code, notes, and snippets.

@lupomontero
Last active July 2, 2018 00:12
Show Gist options
  • Save lupomontero/5f9d57d18b957747b9e6f84548de2c31 to your computer and use it in GitHub Desktop.
Save lupomontero/5f9d57d18b957747b9e6f84548de2c31 to your computer and use it in GitHub Desktop.
const reducer = (state = { count: 0 }, action) => {
switch (action.type) {
case 'INCREMENT':
state.count++;
break;
case 'DECREMENT':
state.count--;
break;
}
return state;
};
module.exports = reducer;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment