"Efficient History Storage with JSON Patches: Instead of storing full state snapshots for each history entry, travels uses JSON Patch (RFC 6902) to store only the differences between states. This dramatically reduces memory usage, especially for large state objects with small changes. For example, changing a single field in a 1MB object only stores a few bytes in history. High-Performance Immutable Updates: Mutative is 10x faster than Immer and provides a mutation-based API for updating immutable data structures."
"travels is designed to be framework-agnostic and can be integrated with React, Vue, Zustand, MobX, Pinia, and other libraries. It's suitable for building time travel features in any JavaScript application. ✨ Framework-agnostic core library 🔄 Undo/Redo/Reset/Go/Archive functionalities 🎯 Subscribe to state changes 💪 Mutations update immutable data via Mutative 📦 Small size with efficient JSON Patch history ⚙️ Customizable history size and initial patches"
travels provides a small, framework-agnostic core for undo/redo, reset, go, archive and subscription to state changes. It stores history as RFC 6902 JSON Patches to record only differences between states, drastically reducing memory usage for large objects with small changes. Mutative powers high-performance immutable updates with a mutation-style API that is significantly faster than Immer. travels supports auto and manual archiving, customizable history size, initial patches, and a mark function for custom immutability. Integrations and wrappers exist for Zustand and React, and the package is installable via npm, yarn, or pnpm.
Read at GitHub
Unable to calculate read time
Collection
[
|
...
]