Last active
March 8, 2017 15:24
-
-
Save chiefGui/a7a0e6c923080440df7330fc5d9f13bf 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
const todos = (state = INITIAL_STATE, action) => { | |
switch (action.type) { | |
case ADD_TODO: | |
return [...state.todos, action.todo] | |
case REMOVE_TODO: | |
return state.todos.filter(todo => todo.id !== action.todo.id) | |
default: | |
return state | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment