createSelector3<S, R1, R2, R3, T> function
Create a memoized selector by combining three selectors. It will cache the
result of the combiner
function, and only recompute when the provided
selectors deliver new results.
A complete example can be seen as part of the Selector documentation.
Implementation
Selector<S, T> createSelector3<S, R1, R2, R3, T>(
Selector<S, R1> selector1,
Selector<S, R2> selector2,
Selector<S, R3> selector3,
T Function(R1, R2, R3) combiner, {
T Function(R1, R2, R3) Function(T Function(R1, R2, R3))? memoize,
}) {
final memoized = (memoize ?? memo3)(combiner);
return (S state) {
return memoized(
selector1(state),
selector2(state),
selector3(state),
);
};
}