createSelector2<S, R1, R2, T> function Null safety

Selector<S, T> createSelector2<S, R1, R2, T>(
  1. Selector<S, R1> selector1,
  2. Selector<S, R2> selector2,
  3. T mapFn(
    1. R1,
    2. R2,
    3. dynamic

Create a selector composed from two other selectors.

Creates a memoized selector. The result of the function will only be recomputed when one of the composed selectors returns a new value.


Selector<S, T> createSelector2<S, R1, R2, T>(
  Selector<S, R1> selector1,
  Selector<S, R2> selector2,
  T Function(R1, R2, dynamic) mapFn,
) {
  final memoized = memo3(mapFn);

  return (S state, dynamic props) {
    return memoized(
      selector1(state, props),
      selector2(state, props),