Skip to content

Instantly share code, notes, and snippets.

@piq9117
Last active August 25, 2016 04:58
Show Gist options
  • Save piq9117/27fe87f45d3a59333ab07c8215e94065 to your computer and use it in GitHub Desktop.
Save piq9117/27fe87f45d3a59333ab07c8215e94065 to your computer and use it in GitHub Desktop.
function reducer (state = person, action) {
switch (action.type) {
case 'ADD_FOOD':
return Object.assign({}, state, {
favoriteFood: state.favoriteFood.concat(action.data.food)
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment