Function undoMiddleware

  • Creates an undo middleware.

    Type Parameters

    • S

    Parameters

    • subtreeRoot: object

      Subtree root target object.

    • Optionalstore: UndoStore

      Optional 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.

    • Optionaloptions: 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.