//
// Inclass Redux ToDo Exercise
// ============================
//
// Your task is to implement the reducer below.
//
// Start this exercise by running the dev server:
//    npm run dev
// then navigate to the page and open the devtools console.
// Try adding a new To Do item.  The console shows
// the previous state, the action, and the new state.
// 
// Your task is to implement the reducer to properly
// update the state.
//
// DO NOT USE MUTATION
// there should be NO assignment operators in your solution.
// 
const Reducer = (state =  {
	nextId: 2,
	todoItems: [
	    {id: 0, text: "This is an item", done: false},
	    {id: 1, text: "Another item", done: false}
	]
}, action) => {
	switch(action.type) {
		case 'ADD_TODO':
			state=	{
					nextId : state.nextId + 1, 
					todoItems : [
							...state.todoItems, {id: state.nextId + 1, 
												 text: action.text , 
												 done: false},
	    					]
	    			}
		case 'REMOVE_TODO':
			state =  {
				nextId : state.nextId, 
				todoItems : state.todoItems.filter(({id,text,done}) => {return id != action.id} ) 
	    					
			}
		case 'TOGGLE_TODO':
			state = {
				nextId : state.nextId, 
				todoItems : state.todoItems.map(({id,text,done}) => {
					if(id == action.id) 
						return {id:id, text:text, done:!done};
					else 
						return {id:id, text:text, done:done};
				
				} ) 
			}
		default: 
			return state
	}
}

export default Reducer

@@ -769,14 +769,14 @@
 tate
+ 
 =%09%7B%0D%0A
-%09
 %09%09%09%09
@@ -808,17 +808,16 @@
 , %0D%0A%09%09%09%09
-%09
 todoItem
@@ -828,18 +828,16 @@
 %5B%0D%0A%09%09%09%09%09
-%09
-%09
 ...state
@@ -848,16 +848,23 @@
 oItems, 
+%0D%0A%09%09%09%09%09
 %7Bid: sta
@@ -878,31 +878,16 @@
 Id + 1, 
-%0D%0A%09%09%09%09%09%09%09%09%09%09%09%09 
 text: ac
@@ -902,23 +902,8 @@
 t , 
-%0D%0A%09%09%09%09%09%09%09%09%09%09%09%09 
 done
@@ -922,17 +922,20 @@
     %09%09%09%09
-%09
+    
 %5D%0D%0A%09    
@@ -969,25 +969,24 @@
 %0D%0A%09%09%09state =
- 
  %7B%0D%0A%09%09%09%09next
@@ -994,32 +994,36 @@
 d : state.nextId
+ - 1
 , %0D%0A%09%09%09%09todoItem

Update reducers.js