August 2017
Beginner
374 pages
10h 41m
English
All the custom behavior mentioned in the previous section is already possible if you use the undoable higher-order reducer from the redux-undo library:
import undoable from 'redux-undo'undoable(reducer, options)
For example, you can define a custom action type for undo/redo actions:
import undoable from 'redux-undo'undoable(reducer, { undoType: 'CUSTOM_UNDO', redoType: 'CUSTOM_REDO'})
Alternatively, you can filter certain actions:
import undoable, { includeAction, excludeAction } from 'redux-undo'undoable(reducer, { filter: includeAction(SOME_ACTION) })
undoable(reducer, { filter: excludeAction(SOME_ACTION) })
undoable(reducer, { filter: includeAction([SOME_ACTION, SOME_OTHER_ACTION]) })
undoable(reducer, { filter ...Read now
Unlock full access