reduce6Pods<T, A, B, C, D, E, F> function

ChildPod<dynamic, T> reduce6Pods<T, A, B, C, D, E, F>(
  1. Pods6<A, B, C, D, E, F> instances,
  2. T reducer(
    1. Pods6<A, B, C, D, E, F> instances
    ),
  3. (A?, B?, C?, D?, E?, F?) updateParents(
    1. T childValue
    )?
)

Reduces a tuple 6 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> reduce6Pods<T, A, B, C, D, E, F>(
  Pods6<A, B, C, D, E, F> instances,
  T Function(Pods6<A, B, C, D, E, F> instances) reducer,
  (A?, B?, C?, D?, E?, F?) 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, temp.$4, temp.$5, temp.$6];
          }
        : null,
  );
}