effect-io-ai

Package: effect
Module: Sink

Sink.foldUntil

Folds input elements into state until the specified maximum number of elements has been consumed or the upstream stream ends.

Details

If the sink stops in the middle of a pulled array, the remaining elements from that array are returned as leftovers.

Signature

declare const foldUntil: <S, In, E = never, R = never>(s: LazyArg<S>, max: number, f: (s: S, input: In) => Effect.Effect<S, E, R>) => Sink<S, In, In, E, R>

Source

Since v2.0.0