Redux + localStorage
✓ Published0🌍 Public
RRestuta
Last edited Aug 18, 2016
Created on Aug 18, 2016
This example shows how to persist a Redux store in the browser’s localStorage by syncing state changes through a custom module. The code defines a reducer that handles `SET` and `REMOVE` actions, calling `serialize` to write the updated Immutable.js collection to localStorage after each mutation. On initialization, `deserialize` reads the stored JSON and hydrates the state via `Immutable.Map`. Access to stored values uses memoized `reselect` selectors, while action creators `set` and `remove` trigger updates. The implementation relies on Redux’s reducer/action pattern and the browser’s `localStorage` API.
AI-generated description