May 2019
Intermediate to advanced
496 pages
10h 38m
English
Redo is very similar to undo, just reversed. In our production code, however, we'll need to add a switch statement:
describe('withUndoRedo', () => { const undoAction = { type: 'UNDO' }; const redoAction = { type: 'REDO' }; ...});
describe('redo', () => { let newState; beforeEach(() => { decoratedReducerSpy.mockReturnValueOnce(future); newState = reducer(present, innerAction); ...Read now
Unlock full access