Slide 19
Slide 19 text
To specify how the state tree is transformed by actions, you write pure reducers.
function todos(state = [], action) {
switch (action.type) {
case 'ADD_TODO':
return [
...state, { text: action.text, completed: false }
]
default:
return state
}
}
3 rules of redux 3 - changes are made by pure functions
19