@ -12,8 +12,7 @@ const immutableReducer = (state = ['Do not mutate state!'], action) => {
|
|||||||
switch(action.type) {
|
switch(action.type) {
|
||||||
case 'ADD_TO_DO':
|
case 'ADD_TO_DO':
|
||||||
// don't mutate state here or the tests will fail
|
// don't mutate state here or the tests will fail
|
||||||
let arr = [...state];
|
let arr = [...state, action.todo];
|
||||||
arr.push(action.todo);
|
|
||||||
return arr;
|
return arr;
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
|
Reference in New Issue
Block a user