redux-storage-engine-sessionstorage

window.sessionStorage engine for redux-storage

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
redux-storage-engine-sessionstorage
401.0.28 years ago8 years agoMinified + gzip package size for redux-storage-engine-sessionstorage in KB

Readme

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.
redux-storage: https://github.com/michaelcontento/redux-storage redux-storage-engine-sessionstorage: https://github.com/bmatcuk/redux-storage-engine-sessionstorage es6-promise: https://github.com/stefanpenner/es6-promise