Registry / storage / redux-storage-engine-localforage

redux-storage-engine-localforage

JSON →
library2.0.0jsnpmunverified

A redux-storage engine that persists the Redux state tree to localforage (IndexedDB, WebSQL, or localStorage) with optional JSON replacer/reviver for custom serialization. Current stable version is 2.0.0. It depends on redux-storage >3.0.0 and localforage. Key differentiator: provides a localStorage-like API for offline storage in browsers, with configurable drivers and no need for a server. Release cadence is low; last release was in 2016.

npm install redux-storage-engine-localforage
INSTALL
IMPORT
SIG · REDUX-STORAGE-ENGI
R
redux-storage-engine-localforage
storagejavascriptv2.0.0
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.

createEngine
import createEngine from 'redux-storage-engine-localforage'
import { createEngine } from 'redux-storage-engine-localforage'
Default export only; named import will fail.
createEngine
const createEngine = require('redux-storage-engine-localforage').default
const createEngine = require('redux-storage-engine-localforage')
CommonJS requires .default because the package uses ES modules.
createEngine (with replacer/reviver)
const engine = createEngine('key', config, replacer, reviver)
const engine = new createEngine('key', config, replacer, reviver)
createEngine is a factory function, not a class. Do not use 'new'.

Shows how to import and create a localforage-based storage engine with optional driver configuration.

import createEngine from 'redux-storage-engine-localforage'; import localforage from 'localforage'; const engine = createEngine('my-app', { driver: localforage.WEBSQL }); export default engine;
Debug
Known issues
deprecatedThe redux-storage ecosystem is largely replaced by redux-persist. Consider migrating.
fix
Use redux-persist with localforage adapter: redux-persist-localforage.
affects: *
gotchaBy default, localforage uses IndexedDB with a fallback. If IndexedDB is unavailable in some environments (private browsing in older Safari), storage may fail silently.
fix
Explicitly set driver order or catch errors during engine creation.
affects: *
gotchaThe replacer/reviver parameters are applied to the entire state object serialized to JSON. Nested keys may behave unexpectedly if replacer modifies the structure.
fix
Test replacer/reviver thoroughly; avoid modifying top-level keys used by redux-storage.
affects: *
breakingVersion 2.0.0 dropped support for Node.js < 4 and may require babel-polyfill for older browsers.
fix
Use build tools like webpack with babel-polyfill or target modern browsers.
affects: >=2.0.0
Errors
Common errors & fixes
TypeError: (0 , _reduxStorageEngineLocalforage.default) is not a function
CommonJS require() without .default when using a transpiler that doesn't handle ES modules
fix
Use 'const createEngine = require('redux-storage-engine-localforage').default'
Module not found: Error: Can't resolve 'redux-storage'
Missing peer dependency redux-storage
fix
Install redux-storage: npm install redux-storage
localforage is not defined
localforage not imported or not available in browser
fix
Run 'npm install localforage' and import it before using the engine
Upgrade
Version history
2.0.0latest on npm
Audit
Dependencies
redux-storagerequiredPeer dependency - the engine is designed to work with redux-storage middleware
localforagerequiredRuntime dependency - the engine uses localforage for actual storage
Agent activity
26 hits · last 30 days
node
22
Amazon
1
Resources
redux-storage-engine-localforage — npm install redux-storage-engine-localforage · libregistry