Skip to main content

Function: undoMiddleware()

function undoMiddleware<S>(
subtreeRoot,
store?,
options?
): UndoManager;

Creates an undo middleware.

Type Parameters​

Type Parameter
S

Parameters​

ParameterTypeDescription
subtreeRootobjectSubtree root target object.
store?UndoStoreOptional UndoStore where to store the undo/redo queues. Use this if you want to store such queues somewhere in your models. If none is provided it will reside in memory.
options?UndoMiddlewareOptions<S>Extra options, such as how to save / restore certain snapshot of the state to be restored when undoing/redoing.

Returns​

UndoManager

An UndoManager which allows you to do the manage the undo/redo operations and dispose of the middleware.