I 'm unable to figure out why my code is not working, please help ,
const immutableReducer = (state = ['Do not mutate state!'], action) => {
switch(action.type) {
case 'ADD_TO_DO':
// don't mutate state here or the tests will fail
return [... state, action.todo];
default:
return state;
}
};
const addToDo = (todo) => {
return {
type: 'ADD_TO_DO',
todo: todo
}
}
const store = Redux.createStore(immutableReducer);
https://learn.freecodecamp.org/front-end-libraries/redux/use-the-spread-operator-on-arrays