Skip to content
Buy me a coffee

Gatherer

Defined in: src/stream/Gatherers.ts:14

A custom intermediate operation for stream.gather(gatherer); only integrator() is required. The Gatherer value holds the factories Gatherer.of / Gatherer.ofSequential and the default* sentinels; built-ins are in Gatherers.

  • Gatherer<T, A, R>

T

A

R

optional andThen<RR>(that): Gatherer<T, any, RR>

Defined in: src/stream/Gatherer.ts:45

Returns a gatherer that feeds this one’s output into that; the same as gather(this).gather(that).

RR

Gatherer<R, any, RR>

Gatherer<T, any, RR>

GathererType.andThen


optional combiner(): (left, right) => A

Defined in: src/stream/Gatherer.ts:41

Merges two states in parallel evaluation; the default combiner marks a gatherer sequential-only.

(left, right) => A

GathererType.combiner


optional finisher(): (state, downstream) => void

Defined in: src/stream/Gatherer.ts:43

Returns the function run once at the end (after the last element or a stop); it may push what the state still holds.

(state, downstream) => void

GathererType.finisher


optional initializer(): () => A

Defined in: src/stream/Gatherer.ts:37

Returns the function that creates the state, called once per evaluation.

() => A

GathererType.initializer


integrator(): Integrator<A, T, R>

Defined in: src/stream/Gatherer.ts:39

Returns the Integrator called for each upstream element.

Integrator<A, T, R>

GathererType.integrator