1.0.8 • Published 1 year ago

redux-persist-chrome-storage v1.0.8

Weekly downloads
64
License
MIT
Repository
github
Last release
1 year ago

Redux Persist Chrome Storage

Tests

Storage adaptor for using Google Chrome's Storage API with redux-persist.

The main use case for this adaptor is when writing Chrome extensions and making use of either the Sync, Local or Managed StorageArea drivers to persist your redux state.

Installation

npm: npm install redux-persist-chrome-storage

yarn: yarn add redux-persist-chrome-storage

Usage

import { createStore } from 'redux'
import { persistStore, persistReducer } from 'redux-persist'
import createChromeStorage from 'redux-persist-chrome-storage'
import reducer from './reducers'

// Create a ChromeStorage instance using the chrome runtime and the Sync StorageArea.
const storage = createChromeStorage(window.chrome, 'sync');

const config = {
  key: 'root',
  storage,
};

const persistedReducer = persistReducer(config, reducer);

export default () => {
  let store = createStore(persistedReducer)
  let persistor = persistStore(store)
  return { store, persistor };
}
1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.2

3 years ago

1.0.3

3 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.0.1

6 years ago