A lightweight storage enhancer for redux-localstorage that selectively persists only a subset of the Redux state tree. Version 0.1.1 is the latest stable release, with no recent updates. It allows specifying paths (including nested keys joined by dots) to whitelist state properties for persistence. Unlike generic redux-localstorage middlewares that persist the entire state, this enhancer gives granular control. It is designed for use with the redux-localstorage ecosystem and requires redux-localstorage as a peer dependency. No TypeScript types are shipped.
npm install redux-localstorage-filterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to use the filter enhancer to persist only the 'user.token' path from the Redux state.
Use dot-separated strings for nested keys. For arrays, specify the index as a string? (Note: this package does not support arrays explicitly; test your use case.)
Install redux-localstorage: npm install redux-localstorage
If using TypeScript, declare a module: declare module 'redux-localstorage-filter' { export default function filter(paths: string | string[]): Function; }Use import filter from 'redux-localstorage-filter' instead of import { filter } from 'redux-localstorage-filter'Run npm install redux-localstorage
Ensure filter is called with a non-empty string or array of strings, and compose returns an enhancer that is applied correctly.