reduce3Pods<T, A, B, C> function
Reduces a tuple 3 Pod - instances
to a single ChildPod instance via
reducer
. Optionally provide updateParents
to define how parent Pods
should be updated when this Pod changes.
Implementation
ChildPod<dynamic, T> reduce3Pods<T, A, B, C>(
Pods3<A, B, C> instances,
T Function(Pods3<A, B, C> values) reducer,
(A?, B?, C?) Function(T childValue)? updateParents,
) {
return ChildPod<dynamic, T>(
parents: instances.pods.nonNulls,
reducer: (_) => reducer(instances),
updateParents: updateParents != null
? (e) {
final temp = updateParents(e);
return [temp.$1, temp.$2, temp.$3];
}
: null,
);
}