0.0.2 • Published 5 years ago

heridux v0.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

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

Example in action

http://yannickbochatay.github.io/heridux