May 2019
Intermediate to advanced
496 pages
10h 38m
English
We'll create a new action, UNDO, which causes us to push the current state into a new array called past:
describe('withUndoRedo', () => { const undoAction = { type: 'UNDO' }; const innerAction = { type: 'INNER' }; const present = { a: 123, nextInstructionId: 0 }; const future = { b: 234, nextInstructionId: 1 }; ...});
Read now
Unlock full access