1.2.1 • Published 1 year ago

@dynamic-selectors/with-reselect v1.2.1

Weekly downloads
3
License
MIT
Repository
github
Last release
1 year ago

@dynamic-selectors/with-reselect

Helper functions to make it easy to use Dynamic Selectors and Reselect together.

For more information or related packages, see the Dynamic Selectors workspace.

npm version build status test coverage dependencies status gzip size

What's included

import {
  reselectSelectorFromDynamic,
  dynamicSelectorFromReselect,
  wrapReselect,
} from '@dynamic-selectors/with-reselect';

reselectSelectorFromDynamic(dynamicSelector, params?)

Create a Reselect selector from any dynamic selector. You can specify the params to use with the dynamic selector, if it accepts params.

const originalSelector = createDynamicSelector(/* dynamic-selector for use with reselect */);
const newSelector = reselectSelectorFromDynamic(originalSelector);

dynamicSelectorFromReselect(reselectSelector)

Creates a normal dynamic selector from any Reselect selector (using createDynamicSelector, by default). If you're using a custom dynamic selector factory, you should use wrapReselect instead.

const originalSelector = createSelector(/* reselect selector for use with dynamic-selectors */);
const newSelector = dynamicSelectorFromReselect(originalSelector);

wrapReselect(reselectSelector)

Converts any Reselect selector into a function that you can pass to your own customized dynamic selector factory. The default dynamicSelectorFromReselect helper is just shorthand for createDynamicSelector(wrapSelector(selectorFn))

const myCustomSelectorFactory = dynamicSelectorForState(/* custom options */);

const originalSelector = createSelector(/* custom dynamic-selector for use with reselect */);
const newSelector = myCustomSelectorFactory(wrapSelector(originalSelector));
1.2.0

1 year ago

1.2.1

1 year ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago

0.4.0

3 years ago

0.3.0

3 years ago

0.3.1

3 years ago

0.2.2

3 years ago

0.2.1

4 years ago

0.2.0

4 years ago