Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

redux-persist-webextension-storage

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-persist-webextension-storage

WebExtension Storage engine for redux-persist

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11K
increased by14.32%
Maintainers
1
Weekly downloads
 
Created
Source

redux-persist-webextension-storage

A WebExtension Storage storage engine for redux-persist.

Installation

Add the redux-persist-webextension-storage NPM package via NPM or Yarn:

$ yarn add redux-persist-webextension-storage

Usage

There are separate storage engines for local storage and sync storage. Import the one you need, or both, and pass them as storage engines when configuring your store.

// configureStore.js

import { combineReducers, createStore } from 'redux'
import { persistStore, persistReducer } from 'redux-persist'
import { localStorage, syncStorage } from 'redux-persist-webextension-storage'

import localStorageReducer from './localStorageReducer';
import syncStorageReducer from './syncStorageReducer';

const localStorageConfig = {
  key: 'localStorage',
  storage: syncStorage,
}

const syncStorageConfig = {
  key: 'syncStorage',
  storage: syncStorage,
}

// Persist each of the storage areas under different keys and with different storage engines.
const rootReducer = combineReducers({
  localStorage: persistReducer(localStorageConfig, localStorageReducer),
  syncStorage: persistReducer(syncStorageConfig, syncStorageReducer),
})

export default () => {
  const store = createStore(rootReducer)
  const persistor = persistStore(store)
  return { store, persistor }
}

Keywords

FAQs

Package last updated on 08 Sep 2018

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