Skip to content

Function: useHistoryManager()

useHistoryManager<TRow>(options): HistoryManagerReturn<TRow>

Defined in: src/tree-editor/use-history-manager.ts:41

Hook managing undo/redo history for tree commands.

  • Executing a command applies it and pushes to the undo stack.
  • Undo reverses the last command and pushes to the redo stack.
  • Redo re-applies the last undone command.
  • Executing a new command clears the redo stack.
  • History depth is enforced by dropping the oldest commands.

Type Parameters

TRow

TRow

Parameters

options

UseHistoryManagerOptions<TRow>

Returns

HistoryManagerReturn<TRow>