Home

Awesome

redux-storage-engine-sessionstorage

dependencies devDependencies

license npm version npm downloads

window.sessionStorage based engine for redux-storage.

Installation

npm install --save redux-storage-engine-sessionstorage

Usage

Stores everything inside window.sessionStorage.

import createEngine from 'redux-storage-engine-sessionstorage';
const engine = createEngine('my-save-key');

Note: Session Storage is limited to the tab/window in which it has been set. This means that if a user opens your app in a new tab or window, they'll get a new session storage. The session storage is only really useful if your app consists of multiple pages (since all pages on the domain will have access to it), or if the user navigates away and returns in the same tab/window.

Warning: sessionStorage does not expose a async API and every save/load operation will block the JS thread!

Warning: Some browsers like IE<=11 does not support Promises! You could use something like es6-promise to polyfill.