Registry / storage / redux-storage-engine-sessionstorage

redux-storage-engine-sessionstorage

JSON →
library1.0.2jsnpmunverified

A sessionStorage-based engine for redux-storage (v1.0.2, last updated 2016). This package provides a simple way to persist Redux state to window.sessionStorage using the redux-storage middleware/toolkit. It is synchronous, blocking the JS thread on save/load. The package is unmaintained and has no TypeScript types. Compared to localStorage, sessionStorage is scoped to the tab/window and cleared when the tab is closed. Requires redux-storage core package and a Promise polyfill for IE <= 11. The npm status indicates it is deprecated in favor of redux-storage-decorator-filter or similar packages.

npm install redux-storage-engine-sessionstorage
INSTALL
IMPORT
SIG · REDUX-STORAGE-ENGI
R
redux-storage-engine-sessionstorage
storagejavascriptv1.0.2
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-sessionstorage'
const createEngine = require('redux-storage-engine-sessionstorage')
The package's default export is createEngine; CommonJS require works but is not the recommended ES module style.
default import
import createEngine from 'redux-storage-engine-sessionstorage'
import { createEngine } from 'redux-storage-engine-sessionstorage'
There is no named export; only a default export. Named imports will result in undefined.
Promise polyfill (optional)
import 'es6-promise/auto'
Required for browsers that don't support Promises (IE <= 11). Import the polyfill before using the engine.

Shows how to create a sessionStorage engine, integrate with redux-storage middleware, and load state on store creation.

import { createStore, applyMiddleware } from 'redux'; import createEngine from 'redux-storage-engine-sessionstorage'; import reduxStorage from 'redux-storage'; const engine = createEngine('my-app-key'); const storageMiddleware = reduxStorage.createMiddleware(engine); function reducer(state = { count: 0 }, action) { switch (action.type) { case 'INCREMENT': return { ...state, count: state.count + 1 }; default: return state; } } const store = createStore(reducer, applyMiddleware(storageMiddleware)); reduxStorage.createLoader(engine)(store).then(() => { console.log('State loaded from sessionStorage'); }); store.dispatch({ type: 'INCREMENT' });
Debug
Known issues
deprecatedThis package is no longer maintained. The last update was in 2016, and it recommends migrating to redux-storage-decorator-filter or similar.
fix
Consider using modern alternatives like redux-persist which has built-in sessionStorage support and better API.
affects: >=1.0.0
gotchasessionStorage is synchronous and blocks the JS thread on every save/load operation.
fix
Be aware that this can cause performance issues, especially with large state. Use localStorage or async engines when possible.
affects: >=0.0.0
gotchasessionStorage is limited to the current tab/window. Opening a new tab will start with empty state.
fix
If you need cross-tab persistence, use redux-storage-engine-localstorage instead.
affects: >=0.0.0
gotchaIE <= 11 does not support Promises; an explicit polyfill is required.
fix
Import a Promise polyfill like es6-promise before using the engine.
affects: >=0.0.0
deprecatedThe redux-storage ecosystem is deprecated. This engine is tied to a legacy middleware pattern.
fix
Migrate to redux-persist, which has active maintenance and broader ecosystem support.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot read property 'createMiddleware' of undefined
redux-storage not installed or imported incorrectly.
fix
Ensure redux-storage is installed and imported: import reduxStorage from 'redux-storage'.
Missing Promise polyfill in this browser
Browser does not support Promises (e.g., IE 11 without polyfill).
fix
Install and import a Promise polyfill: import 'es6-promise/auto' at the entry point.
TypeError: sessionStorage is not defined
Code is running in an environment without sessionStorage (Node.js, server-side rendering).
fix
Wrap the engine creation in a isBrowser check, or use a redux-storage decorator that falls back to a no-op engine on the server.
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies
redux-storagerequiredThis package is an engine for redux-storage; it requires the core package to function as a middleware.
Agent activity
26 hits · last 30 days
node
22
Amazon
1
OpenAI (training)
1
Resources
redux-storage-engine-sessionstorage — npm install redux-storage-engine-sessionstorage · libregistry