Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including redux-get with all npm packages installed. Try it out:

var reduxGet = require("redux-get")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

redux-get v1.0.0

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

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

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free