mobx-bonsai
    Preparing search index...

    Interface UndoManagerOptions<TAttachedState>

    Options for creating an UndoManager.

    interface UndoManagerOptions<TAttachedState = unknown> {
        attachedState?: AttachedStateHandler<TAttachedState>;
        groupingDebounceMs?: number;
        maxRedoLevels?: number;
        maxUndoLevels?: number;
        rootNode: object;
        store?: UndoStore;
    }

    Type Parameters

    • TAttachedState = unknown
    Index

    Properties

    Attached state management for storing additional state with each undo event.

    groupingDebounceMs?: number

    Time window in milliseconds for grouping changes into a single undo event. If undefined (default), changes are only grouped within the same MobX action. If set to a number, changes that occur within this time window will be merged into the last undo event, even if they come from different actions.

    undefined
    
    maxRedoLevels?: number

    Maximum number of redo levels to keep.

    Infinity
    
    maxUndoLevels?: number

    Maximum number of undo levels to keep.

    Infinity
    
    rootNode: object

    The subtree root to track changes on.

    store?: UndoStore

    Optional UndoStore to use. If not provided, a new one will be created.

    Note: The UndoStore is not subject to the undo manager, even if it is a child of the rootNode. Changes to the UndoStore itself will not be tracked or undoable.