redux-get

1.0.0 • Public • Published

Redux Get

Build Status code style: prettier

Redux enhancer to access state props and selectors via a simple store.get() method.

Install

npm i --save redux-get

API

createGetters(selectors)

selectors
A single map containing all the selectors with a similar shape as your reducer.

store.get(selector)

selector A selector function, object.dot.path or ['array', 'path'].

Returns the store value.

store.getSelectors()

Returns the selectors map.

store.createGetter(paths) A selector object.dot.path or ['array', 'path'].

Returns a selector function.

Usage

const store = createStore(reducer, createGetters(selectors))

Related

If you would like to access selectors as straight up getters from the state object returned by store.getState() have a look at this project https://github.com/luwes/redux-proxy-selectors

Readme

Keywords

none

Package Sidebar

Install

npm i redux-get

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • luwes