Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@heridux/core
Advanced tools
Creation of Heridux store
STATE_PROPERTY
String string name for this slice of state. Generated actions wille use this as a prefix.Set a first level value without creating a specific action
prop
String property namevalue
any property valueReturns undefined
Get store slice
state
Immutable.Map? global state (if not specified, call getState method of redux store)Returns Immutable.Map store slice
Get js value of a first level key
key
String key namestate
Immutable.Map? global state (if not specified, call getState method of redux store)Returns any key value (converted in plain js if immutable)
Get js value of a nested key
path
Array Iterable key path (more details in Immutable.js documentation)state
Immutable.Map? global state (if not specified, call getState method of redux store)const store = new Heridux("myPartialStore")
store.setInitialState({
list : [{ name : "foo"}, { name : "bar" }]
})
store.getIn(["list", 0, "name"]) // foo
Returns any key value (converted in plain js if immutable)
Define the initial state of the store slice. It will automatically be converted to immutable.
state
Object plain js stateReturns undefined
Create action/reducer couple
const myStore = new Heridux("myPartialStore")
myStore.setInitialState({
list : ["foo", "bar"]
})
myStore.createAction("pop", state => state.update("list", arr => arr.pop())
myStore.execAction("pop")
myStore.get("list") // ["foo"]
Returns undefined
Execute action registered by createAction method
Returns undefined
Register heridux store in global redux store
Returns undefined
dispatch any action on global redux store
FAQs
The easiest way to use and reuse redux stores or react internal states
The npm package @heridux/core receives a total of 3 weekly downloads. As such, @heridux/core popularity was classified as not popular.
We found that @heridux/core demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.