Reduxed Chrome Storage
Redux interface to chrome.storage
. The only way to get Redux working in event-driven (non-persistent) Chrome extensions (aside from full reproduction of the Redux code).
Installation
With NPM:
npm install reduxed-chrome-storage
Usage
Standard way (Promises):
import { createStore } from 'redux';
import storeCreatorFactory from 'reduxed-chrome-storage';
import reducer from './reducer';
const storeCreator = storeCreatorFactory({ createStore, chrome });
storeCreator(reducer).then(store => {
const state = store.getState();
...
});
Advanced way (async/await
):
...
async () => {
const storeCreator = storeCreatorFactory({ createStore, chrome });
const store = await storeCreator(reducer);
...
}
...
One-liner:
...
async () => {
const store = await storeCreatorFactory({ createStore, chrome }) (reducer);
...
}
...
License
Licensed under the MIT license.