Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@heridux/core

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@heridux/core

The easiest way to use and reuse redux stores or react internal states

  • 0.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Table of Contents

  • Heridux

Heridux

Creation of Heridux store

Parameters

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

getState

Get store slice

Parameters
  • state Object? global state (if not specified, call getState method of redux store)

Returns Object store slice

get

Get js value of a first level key

Parameters
  • key String key name
  • _state Object? global state (if not specified, call getState method of redux store)

Returns any key value

setInitialState

Define the initial state of the store slice

Parameters

Returns undefined

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.update("list", arr => arr.pop())

myStore.execAction("pop")

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

Returns undefined

execAction

  • **See: createAction **

Execute action registered by createAction method

Parameters
  • name String action short name
  • options Object additional parameters

Returns undefined

register

Register heridux store in global redux store

Returns undefined

dispatch

dispatch any action on global redux store

Parameters

Returns undefined

Keywords

FAQs

Package last updated on 02 Feb 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc