redux-worker
Redux implementation in a web worker. The entire state is kept in a separate thread. (this also gives the added benefit of immutable objects)
import { createStore } from 'redux-worker/core';// Or if using bundle.// var createStore = Rw.createStore; // the reduces is run in a new threadvar store = createStore((state, action) => { switch(action.type) { case 'INCREMENT': return state + 1; case 'DECREMENT': return state - 1; default: return state; }}, 0); // get state has to be async since the state is managed is a separate threadstore.getState(state => { console.log(state) // 0}); // subscribe to the store for changes.// the web worker acts as the dispatcher with onmessage and postMessagestore.subscribe(state => { console.log(state);}); // standard redux style dispatchstore.dispatch({ type: 'INCREMENT' });