0.0.1 • Published 3 years ago

@heridux/immer v0.0.1

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

Table of Contents

HeriduxImmer

Extends Heridux

Creation of Heridux store

Parameters

  • STATE_PROPERTY String string name for this slice of state. Generated actions wille use this as a prefix.

createAction

Create action/reducer couple

Parameters

  • name String action short name
  • reducer Function function to modify the state

Examples

const myStore = new Heridux("myPartialStore")

myStore.setInitialState({
 list : ["foo", "bar"]
})

myStore.createAction("pop", state => { state.list.pop() })

myStore.execAction("pop")

myStore.get("list") //  ["foo"]

Returns undefined

set

Set a first level value without creating a specific action

Parameters

  • prop String property name
  • value any property value

Returns undefined