Closed cbranch101 closed 8 years ago
const todo = createReducer(undefined, { 'ADD_TODO' : (state, action) => { id: action.id, text: action.text, completed: false }, 'TOGGLE_TODO' : (state, action) => { if (state.id !== action.id) { return state }
return Object.assign({}, state, { completed: !state.completed })
} });
const todo = createReducer(undefined, { 'ADD_TODO' : (state, action) => { id: action.id, text: action.text, completed: false }, 'TOGGLE_TODO' : (state, action) => { if (state.id !== action.id) { return state }
} });