- Source:
Methods
-
<inner> createSelector(properties [, getComputedValue] [, customMemoizer] [, customMemoizerOptions])
-
based on the array of properties and the reducer passed create a selector
Parameters:
Name Type Argument Default Description properties
Array.<string> | Object properties to retrieve from state
getComputedValue
function <optional>
getIdentityValue method for getting the computed value from the properties
customMemoizer
function <optional>
null custom memoizer function to use in place of the default
customMemoizerOptions
Object <optional>
{} additional options for using the custom memoizer option
- Source:
Returns:
- Type
- function
Example
import { createSelector } from 'arco'; const hasBaz = createSelector(['foo.bar[0].baz'], (baz) => { return !!baz; }); hasBaz({foo: {bar: [{ baz: 'Here!'}]}}); // true hasBaz({foo: {bar: [{ baz: 'Here!'}]}}); // true, pulled from cache