Package Exports
- reduxed-chrome-storage
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (reduxed-chrome-storage) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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):
// Note: the usage is the SAME for ANY extension component
// (background or content script or popup - no matter)
import { createStore } from 'redux';
import storeCreatorFactory from 'reduxed-chrome-storage';
import reducer from './reducer';
/* global chrome */
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.