@flownote/command-history
v0.2.0
Published
Framework-agnostic command-pattern undo/redo history manager.
Maintainers
Readme
@flownote/command-history
Framework-agnostic command-pattern undo/redo history manager.
Versioning: experimental 0.x (breaking changes can ship in minor releases).
Install
npm i @flownote/command-historyAPI
CommandinterfaceHistoryclass:push,undo,redo,clear,canUndo,canRedo- Constructor options:
{ maxSize?: number }
Example
import { History, type Command } from "@flownote/command-history";
const history = new History({ maxSize: 200 });
const cmd: Command = {
description: "Toggle flag",
execute() {},
undo() {},
};
history.push(cmd);