New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

redux-persistence-engine-localstorage

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-persistence-engine-localstorage

LocalStorage engine for redux-persistence

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

redux-persistence-engine-localstorage

LocalStorage engine for redux-persistence

Installation

npm install --save redux-persistence-engine-localstorage

Usage

Stores everything inside window.localStorage.

import createEngine from 'redux-persistence-engine-localstorage'
const engine = createEngine('my-save-key')

You can customize the saving and loading process by providing a replacer and/or a reviver.

import createEngine from 'redux-storage-engine-localstorage';

function replacer (key, value) {
  if (typeof value === 'string') {
    return 'foo';
  }
  return value;
}

function reviver (key, value) {
  if (key === 'foo') {
    return 'bar';
  }
  return value;
});

const engine = createEngine('my-save-key', replacer, reviver);

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

Warning: This library only works on browsers that support Promises (IE11 or better)

Warning: If the browser doest not support LocalStorage, that should be handled before passing the engine to redux-persistence (see test)

Keywords

FAQs

Package last updated on 06 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc