Integrator
Integrator:
object
Defined in: src/stream/Gatherers.ts:19
Factories for Integrator.
Type Declaration
Section titled “Type Declaration”ofGreedy
Section titled “ofGreedy”ofGreedy: <
A,T,R>(fn) =>Integrator<A,T,R>
Returns a greedy Integrator wrapping fn: it consumes all input and only the downstream may stop it
(it returns what downstream.push returns, or true). Greedy lets the engine skip short-circuit checks, and a
greedy integrator is never mistaken for an initializer by Gatherer.ofSequential. Like the reference, null is
returned as-is.
Type Parameters
Section titled “Type Parameters”A
T
R
Parameters
Section titled “Parameters”(state, element, downstream) => boolean
Returns
Section titled “Returns”Integrator<A, T, R>
of<
A,T,R>(integrator):Integrator<A,T,R>
Returns the given function as an Integrator that may stop the upstream by returning false. The function
is returned unchanged (like the reference, no null check).
Type Parameters
Section titled “Type Parameters”A
T
R
Parameters
Section titled “Parameters”integrator
Section titled “integrator”(state, element, downstream) => boolean
Returns
Section titled “Returns”Integrator<A, T, R>