AggregateOperation<T, K, R> typedef
AggregateOperation<T, K, R> =
R Function(K key, R? accumulator, T element, bool first)
A function that is invoked on each element.
The parameters are as followed:
- The
keyis the key of the group this element belongs to. - The
accumulatoris the current value of the accumulator of the group. Can benullif it is the firstelementencountered in the group. - The
elementis the element from the source that is being aggregated. - And
firstindicates whether it's the firstelementencountered in the group.
Implementation
typedef AggregateOperation<T, K, R> = R Function(
K key,
R? accumulator,
T element,
bool first,
);