The undo and redo stacks of steps (DOM-free): a new step clears the redo stack; at most maxSteps steps and
maxCells cells (over both stacks) are kept – the oldest go first; a single step with more than maxCells cells
empties the history and is not kept.
Example
conststack = newUndoStack<{ cellCount: number; label: string }>(100, 1_000_000); stack.push({ cellCount:1, label:"Edit" }); stack.undo()?.label; // "Edit" – now on the redo stack stack.canRedo(); // true
The undo and redo stacks of steps (DOM-free): a new step clears the redo stack; at most
maxStepssteps andmaxCellscells (over both stacks) are kept – the oldest go first; a single step with more thanmaxCellscells empties the history and is not kept.Example
Since
1.1.99