Skip to content

Function: selector()

selector<T, U>(selectors, projection?): (props?) => (state) => undefined | U

Defined in: selectors.ts:66

Composes multiple selectors into one, applying an optional projection function.

Type Parameters

T

T = any

Slice type extracted from state.

U

U = any

Final return type after projection.

Parameters

selectors

A selector or array of selectors for extracting intermediate values.

SelectorFunction | SelectorFunction[]

projection?

ProjectionFunction

Optional function to project intermediate values into a final result.

Returns

A selector that computes a derived value from the slice using the specified selectors.

(props?): (state) => undefined | U

Parameters

props?

any

Returns

(state): undefined | U

Parameters

state

T

Returns

undefined | U

Released under the MIT License.