regolithed / react-bedrock

React and Redux Boilerplate
4 stars 2 forks source link

Set up reducer construction process #22

Closed cbranch101 closed 8 years ago

cbranch101 commented 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
})

} });