createSelector<S, T> function

Selector<S, T> createSelector<S, T>(
  1. T mapFn(
    1. S,
    2. dynamic
    )
)

Create a selector from the App's State.

Creates a memoized selector. The result of the function will only be recomputed when the provided state or props change.

Implementation

Selector<S, T> createSelector<S, T>(
  T Function(S, dynamic) mapFn,
) {
  final memoized = memo2(mapFn);
  return (S state, dynamic props) {
    return memoized(state, props);
  };
}