You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constADD_TO_DO='ADD_TO_DO';// A list of strings representing tasks to do:consttodos=['Go to the store','Clean the house','Cook dinner','Learn to code',];constimmutableReducer=(state=todos,action)=>{switch(action.type){caseADD_TO_DO:
// don't mutate state here or the tests will failreturn[...state,action.todo];default:
returnstate;}};// an example todo argument would be 'Learn React',constaddToDo=(todo)=>{return{type: ADD_TO_DO,
todo
}}conststore=Redux.createStore(immutableReducer);