August 2017
Beginner
374 pages
10h 41m
English
We now implement the enhanced reducer function, which will contain the main undo/redo logic. Edit the following function:
return function enhancedReducer (state = initialState, action) { // TODO }
Replace the // TODO line by doing the following:
const { past, present, future } = state
switch (action.type) { case actionTypes.UNDO: { return state // TODO } case actionTypes.REDO: { return state // TODO } default: { return state // TODO } }
Read now
Unlock full access