reduce<T1, T2> static method

ChildPod<T1, T2> reduce<T1, T2>(
  1. Iterable<GenericPod<T1>> responder(),
  2. T2 reducer(
    1. Iterable<GenericPod<T1>> values
    )
)

Reduces multiple Pods into a ChildPod.

Implementation

static ChildPod<T1, T2> reduce<T1, T2>(
  Iterable<GenericPod<T1>> Function() responder,
  T2 Function(Iterable<GenericPod<T1>> values) reducer,
) {
  return ChildPod<T1, T2>._(
    responder: responder,
    reducer: (_) {
      final response = responder();
      return reducer(response);
    },
  );
}