Registry / storage / redux-storage-decorator-engines

redux-storage-decorator-engines

JSON →
library1.0.7jsnpmunverified

A decorator for redux-storage that allows composing multiple storage engines (e.g., localStorage, sessionStorage, cookies) into a single engine. Current stable version is 1.0.7, last updated in 2015. It works by wrapping an array of engines and delegating load/save operations to each. The library is minimal and has no dependencies, but it requires redux-storage and engine packages to be useful. A key warning: if the same state key is loaded from multiple engines, the final state is non-deterministic and a warning is emitted in non-production environments.

npm install redux-storage-decorator-engines
INSTALL
IMPORT
SIG · REDUX-STORAGE-DECO
R
redux-storage-decorator-engines
storagejavascriptv1.0.7
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

engines
✓ import engines from 'redux-storage-decorator-engines'
✗ const engines = require('redux-storage-decorator-engines')
Default export only; no named exports.

Demonstrates how to compose multiple storage engines using the decorator, including a custom cookie engine.

import engines from 'redux-storage-decorator-engines'; import filter from 'redux-storage-decorator-filter'; import createLocalStorageEngine from 'redux-storage-engine-localstorage'; import createSessionStorageEngine from 'redux-storage-engine-sessionstorage'; const localStorageEngine = filter(createLocalStorageEngine('redux'), ['todos']); const sessionStorageEngine = filter(createSessionStorageEngine('redux'), ['visibilityFilter']); const storageEngine = engines([ localStorageEngine, sessionStorageEngine ]); // Optionally add a custom engine for cookies import Cookies from 'js-cookie'; const cookieStorage = { load() { const state = { cookie: Cookies.get('cookie') }; return Promise.resolve(state); }, save() { return Promise.resolve(); } }; const combinedEngine = engines([localStorageEngine, sessionStorageEngine, cookieStorage]);
Debug
Known issues
gotchaIf the same state key is loaded from more than one storage engine, the final state is non-deterministic and depends on load order.
fix
Ensure each engine loads unique keys to avoid non-deterministic behavior.
affects: all
deprecatedThis package is part of the legacy redux-storage ecosystem which is no longer actively maintained.
fix
Consider migrating to modern state persistence solutions like redux-persist.
affects: all
gotchaThe package does not provide TypeScript type definitions; manual type declarations may be needed.
fix
Write a declaration file or use // @ts-ignore.
affects: all
Errors
Common errors & fixes
TypeError: engines is not a function
Using named import instead of default import.
fix
Use default import: import engines from 'redux-storage-decorator-engines'
Cannot find module 'redux-storage-decorator-engines'
Package not installed or missing from node_modules.
fix
Run 'npm install --save redux-storage-decorator-engines' and ensure the module is in dependencies.
Warning: Duplicate state key 'todos' loaded from multiple engines.
Multiple storage engines providing the same state key.
fix
Ensure each engine contributes unique keys to avoid non-deterministic loading.
Upgrade
Version history
1.0.7latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
29 hits · last 30 days
node
24
Amazon
1
Resources
redux-storage-decorator-engines — npm install redux-storage-decorator-engines · libregistry