heridux

0.0.2 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i heridux

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

84.5 kB

Total Files

10

Last publish

Collaborators

  • ybochatay