Skip to content

Instantly share code, notes, and snippets.

@jackfranklin
Created May 10, 2016 10:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jackfranklin/8feccafa9cbc227800247e3d0988cd31 to your computer and use it in GitHub Desktop.
Save jackfranklin/8feccafa9cbc227800247e3d0988cd31 to your computer and use it in GitHub Desktop.
case 'TOGGLE_TODO':
const todos = state.todos.map((todo) => {
if (todo.id === action.id) {
todo.done = !todo.done;
}
return todo;
});
return { todos };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment