Travels
lastmod 2025-12-29created 2025-12-291 edits
A blazing-fast undo/redo core based on Mutative JSON Patch
About
- Efficiently implements undo/redo history management in text editors, drawing tools, form builders, and so on
- A lightweight undo/redo engine that works with JSON Patch (storing only the differences) instead of copying full snapshots
- Runs on top of Mutative, supporting intuitive and fast immutable updates such as draft.count++
- A framework-agnostic design that fits any state management, such as React, Vue, Zustand, MobX, or vanilla JS; just pass in the state anywhere to reuse it as an undo/redo core
- Because the change history is patch-based, memory usage is small and performance degrades little even with large state
- Cleanly provides essential time-travel features such as automatic/manual archive modes, a maximum history size limit, and JSON-serialization-based state restoration
See also
- Json
- Mutative JSON Patch