heridux
v0.0.2
Published
the simpliest way to use and reuse redux stores
Downloads
2
Readme
Heridux
The simpliest way to use and reuse redux stores.
See especially react-heridux.
Installation
With npm or yarn.
npm install heridux
yarn install heridux
Basic example
import Heridux from "heridux"
Heridux.createReduxStore() //create global redux store
const hStore = new Heridux("keyForPartialStore") // create as many partial stores as you want
hStore.setInitialState({ counter : 0 }) // state will be converted to Immutable
hStore.createAction("increment", state => ( // define your actions
state.update("counter", state.get("counter") + 1)
))
hStore.createAction("decrement", state => (
state.set("counter", state.get("counter") - 1)
))
hStore.register() // register this store to the global redux store