A meta-reducer that automatically syncs @ngrx store state with browser local or session storage.
ngrx-store-localstorage is an NgRx meta-reducer library that automatically persists the application's Redux state to the browser's local storage or session storage. It solves the problem of state loss on page reloads by seamlessly syncing defined state slices, enabling features like user preferences, form drafts, or shopping carts to survive browser sessions.
Angular developers using NgRx for state management who need to persist application state across page reloads or browser sessions without implementing custom storage logic.
Developers choose it for its tight integration with NgRx, minimal configuration, and powerful features like conditional syncing, encryption, and custom serialization—saving time over building and maintaining a custom persistence layer.
Simple syncing between @ngrx store and local storage
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Seamlessly integrates as an NgRx meta-reducer to automatically persist state to localStorage or sessionStorage, eliminating manual save/load code as shown in the usage examples.
Supports granular control through keys configuration, allowing partial state syncing, custom serialization, and encryption, detailed in the LocalStorageConfig API.
Enables context-aware syncing with the syncCondition function, such as for 'remember me' features, ensuring state is only saved under specified conditions.
Includes known workarounds for syncing state across multiple browser tabs, addressing a common pain point in multi-window applications.
Tightly coupled with Angular and NgRx, making it unsuitable for projects using other frameworks or state management libraries, as noted in the dependencies.
The extensive API with nested options and custom functions can be overwhelming for simple use cases, requiring a steep learning curve to leverage fully.
Relies on browser storage with inherent limits (typically 5-10MB per origin), not ideal for large state objects without external management.
Requires explicit handling for server-side rendering via checkStorageAvailability, adding setup complexity for Angular Universal apps.