A lightweight, configurable undo-redo library for Angular applications built on NgRx and immer.js.
ngrx-wieder is a library that provides undo-redo functionality for Angular applications using NgRx and immer.js. It enables developers to track state changes and revert or reapply them with minimal configuration, enhancing user experience in complex applications.
Angular developers using NgRx for state management who need to implement undo-redo features in applications like document editors, form builders, or interactive tools.
Developers choose ngrx-wieder because it integrates seamlessly with existing NgRx workflows and immer.js, offering a lightweight, configurable solution with features like action-specific undoability, state segmentation for multi-instance scenarios, and built-in history selectors for UI control.
Lightweight undo-redo for Angular with NgRx & immer.js
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Integrates directly with NgRx reducers using createUndoRedoReducer or wrapReducer, allowing undo-redo to be added with minimal changes to existing code, as shown in the usage examples where standard NgRx patterns are maintained.
Offers fine-grained control over undoable actions and merge rules via allowedActionTypes and mergeRules, enabling tailored behavior for scenarios like sliders or drawing tools, detailed in the configuration and consecutive changes sections.
Supports separate undo-redo stacks for different state segments using segmentation, ideal for applications like multi-document editors, demonstrated with the activeDocument example and segmenter functions.
Provides selectors like selectCanUndo and selectCanRedo through createHistorySelectors, simplifying UI updates for undo-redo buttons and reducing boilerplate, as illustrated in the history selectors section.
Requires immer.js for state updates, adding a mandatory dependency and necessitating adoption of its mutating API, which can be a barrier for teams not already using immer or preferring other immutable patterns.
Setting up undo-redo involves multiple configuration options such as allowedActionTypes, mergeRules, and segmentationOverride, which can be overwhelming for simple use cases and require careful tuning to avoid unintended behavior.
Lacks built-in support for server-side undo or state persistence, limiting its utility in applications requiring robust data synchronization or collaborative editing beyond client state management.