3.0.4 • Published 6 years ago

@modular-toolkit/selectors v3.0.4

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

selectors

Utility functions to use selectors for decoupled React components with a global Redux state.

Installation

npm install --save @modular-toolkit/selectors

API

createModularSelector

This is a drop in replacement for reselect.createSelector and is used to create composed, cachable selectors.

This drop-in replacement is required, because the original function provided by Reselect does not play nicely with the registerSelectorsForUseWithGlobalState module.

registerSelectorsForUseWithGlobalState

This utility function allows you to register selectors that use the context of a self-contained module to a global Redux state.

For an example, take a look at this code from the demo app:

import { registerSelectorsForUseWithGlobalState } from '@modular-toolkit/selectors';
import * as hackerNewsSelectors from '@modular-toolkit/demo-module/selectors';

export default () => registerSelectorsForUseWithGlobalState(
    'modules.hackerNews',
    hackerNewsSelectors
);
  • The first argument is a string that denotes the path to the module's state in the global state
  • The second argument is an object containing the selectors

selectModular

A version of redux-saga.select, allows you to use the global selector mechanism described above with Sagas.

Change Log

Contribution Guidelines

License

MIT licensed

Copyright © 2018 mobile.de GmbH

4.0.0-beta.2

6 years ago

4.0.0-beta.0

6 years ago

3.0.4

6 years ago

3.0.4-beta.1

7 years ago

3.0.4-beta.0

7 years ago

3.0.3

7 years ago

3.0.3-beta.0

7 years ago

3.0.2

7 years ago

3.0.1

7 years ago

3.0.0

7 years ago

3.0.0-alpha.0

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.0

7 years ago

2.0.0-beta.1

7 years ago

2.0.0-beta.0

7 years ago

1.0.2

7 years ago