Undo Extension
With the Undo Extension we can easily undo actions which have been dispatched to the store.
#
Register the extensionConfigure the store with the UndoExtension
:
#
OptionsThe Undo Extension buffers the last 100 actions by default to be able to undo an action. You can configure the buffer like this:
#
Undo an Action (Redux API)In order to undo an action, we need to cache the action which we want to undo.
Later we can dispatch an undo
action which takes the cached action as payload.
Example:
#
Undo an setState action (FeatureStore)The Undo Extension also enables the undo functionality in Feature Stores.
Read more here Undo setState Actions with undo