{"id":49153,"library":"redux-storage-engine-localstorage","title":"redux-storage-engine-localstorage","description":"A localStorage-based persistent engine for redux-storage, a middleware to persist a Redux store to storage backends. The engine stores the entire state tree as a JSON string under a single key in window.localStorage. Version 1.1.4 is the latest stable release, originally authored by Michael Contento and now maintained by Gunjan Soni. The package is simple but has async issues: localStorage operations block the JS thread. For full async support with IndexedDB or other backends, consider redux-storage-engine-localforage or redux-persist. Since the original project is deprecated, this fork is in maintenance mode but receives updates.","status":"maintenance","version":"1.1.4","language":"javascript","source_language":"en","source_url":"https://github.com/react-stack/redux-storage-engine-localstorage","tags":["javascript","redux","redux-storage","redux-storage-engine","localStorage"],"install":[{"cmd":"npm install redux-storage-engine-localstorage","lang":"bash","label":"npm"},{"cmd":"yarn add redux-storage-engine-localstorage","lang":"bash","label":"yarn"},{"cmd":"pnpm add redux-storage-engine-localstorage","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package provides a default export function; using ES module import is recommended. In CommonJS, use the default property: require('redux-storage-engine-localstorage').default","wrong":"const createEngine = require('redux-storage-engine-localstorage')","symbol":"default export (createEngine)","correct":"import createEngine from 'redux-storage-engine-localstorage'"},{"note":"There is no named export; the module exports a single default function. Named import results in undefined.","wrong":"import { createEngine } from 'redux-storage-engine-localstorage'","symbol":"createEngine","correct":"import createEngine from 'redux-storage-engine-localstorage'"},{"note":"replacer and reviver are passed as separate function arguments, not as an options object.","wrong":"const engine = createEngine('key', { replacer: myReplacer, reviver: myReviver })","symbol":"replacer/reviver usage","correct":"import createEngine from 'redux-storage-engine-localstorage';\nconst engine = createEngine('key', replacer, reviver);"}],"quickstart":{"code":"import { createStore, combineReducers } from 'redux';\nimport { reducer as storageReducer } from 'redux-storage';\nimport createEngine from 'redux-storage-engine-localstorage';\nimport reduxStorageMiddleware from 'redux-storage-middleware';\n\nconst engine = createEngine('my-app-key');\n\nconst reducer = storageReducer(combineReducers({ /* your reducers */ }));\n\nconst middleware = reduxStorageMiddleware(engine);\n\nconst store = createStore(reducer, applyMiddleware(middleware));\n\n// The store is now persisted to localStorage under the key 'my-app-key'.\n// To load persisted state on startup:\nimport * as storage from 'redux-storage';\nstorage.load(engine).then((state) => {\n  // state is the loaded object, can be used to rehydrate store\n});","lang":"javascript","description":"Shows how to create a localStorage engine, integrate it with redux-storage middleware and reducer, and load persisted state on startup."},"warnings":[{"fix":"For larger state trees, consider using an async storage backend like redux-storage-engine-localforage or switch to redux-persist.","message":"localStorage is synchronous and blocks the JS thread during save/load operations.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Check for updates on GitHub; consider migrating to redux-persist for active development.","message":"The original package by michaelcontento is deprecated; this fork is maintained but in maintenance mode.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Include a Promise polyfill (e.g., es6-promise) or use the 'fake-promise' variant.","message":"Internet Explorer <= 11 does not support Promises natively; this engine returns promises that may require a polyfill.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"If you need per-reducer persistence, consider redux-persist or custom middleware.","message":"The engine stores the entire state tree under a single localStorage key; there is no support for separate slices or custom serialization per reducer.","severity":"breaking","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.1.4':44 'async':67,77 'author':51 'backend':25,83 'base':9 'block':71 'consid':84 'contento':54 'deprec':99 'engin':4,11,27,88,117 'entir':30 'fork':101 'full':76 'gunjan':59 'indexeddb':80 'issu':68 'javascript':109 'js':73 'json':35 'key':40 'latest':47 'localforag':89 'localstorag':5,8,69,118 'localstorage-bas':7 'maintain':57 'mainten':104 'michael':53 'middlewar':17 'mode':105 'oper':70 'origin':50,96 'packag':62 'persist':10,19,93 'project':97 'receiv':107 'redux':2,14,21,86,92,110,112,115 'redux-persist':91 'redux-storag':13,111 'redux-storage-engin':114 'redux-storage-engine-localforag':85 'redux-storage-engine-localstorag':1 'releas':49 'simpl':64 'sinc':94 'singl':39 'soni':60 'stabl':48 'state':31 'storag':3,15,24,87,113,116 'store':22,28 'string':36 'support':78 'thread':74 'tree':32 'updat':108 'version':43 'window.localstorage':42","created_at":"2026-06-07T17:00:19.454624+00:00","updated_at":"2026-06-07T17:00:19.454624+00:00","problems":[{"fix":"Use default import: import createEngine from 'redux-storage-engine-localstorage'","cause":"Using named import { createEngine } instead of default import.","error":"TypeError: createEngine is not a function"},{"fix":"Polyfill Promise with a library like es6-promise.","cause":"The engine load method returns a promise but the platform lacks Promise support (e.g., IE11).","error":"Uncaught (in promise) TypeError: Cannot read property 'then' of undefined"},{"fix":"Ensure createEngine is called with a string key: const engine = createEngine('my-key');","cause":"Passing wrong argument to redux-storage middleware; the engine object is not correctly created.","error":"Error: Invalid engine. Must provide object with save and load methods."}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/react-stack/redux-storage-engine-localstorage","github":"https://github.com/react-stack/redux-storage-engine-localstorage","docs":null,"changelog":null,"pypi":null,"npm":"redux-storage-engine-localstorage","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}