Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function todoApp(state = initialState, action) {
- switch (action.type) {
- case ADD_TODO:
- return Object.assign({}, state, {
- todos: [
- ...state.todos,
- {
- text: action.text,
- completed: false
- }
- ]
- })
- default:
- return state
- }
- }
Add Comment
Please, Sign In to add comment