Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

redux-ext

Anissoft40MITdeprecated1.1.4

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

This simple package allow you to use Redux store all across the webextension.

addons, webextensions, chrome, extensions

readme

Redux-ext

This simple package allow you to use Redux store all across the webextension.

How to use

In background.js:

import {compose, applyMiddleware, createStore} from 'redux';
import {MainStore} from 'redux-ext';
import {reducers} from './reducers.js';
import {defaultState} from './defaultState.js';

let _store = createStore(reducers,
        defaultState, 
        compose(applyMiddleware(/*%ALL YOUR MIDDLEWARE%*/))),
    store = new MainStore(_store, 'myname');

store.dispatch(/*...*/);

In content or popup:

import {ProxyStore} from 'redux-ext';

let store = new ProxyStore('myname');

store.ready().then(() => {
    /*your code*/
});