effect-io-ai

Package: effect
Module: Sink

Sink.takeWhileEffect

Collects input elements effectfully while the predicate succeeds.

Details

The first input for which the predicate returns false is consumed and excluded from the result. Any later elements from the same pulled array are returned as leftovers.

Signature

declare const takeWhileEffect: <In, E, R>(predicate: (input: In) => Effect.Effect<boolean, E, R>) => Sink<Array<In>, In, In, E, R>

Source

Since v4.0.0