effect-io-ai

Package: effect
Module: Sink

Sink.forEachWhileArray

Runs an effectful function for each non-empty input array while it returns true.

Details

The sink stops consuming input when the function returns false or when the upstream stream ends, and completes with void.

Signature

declare const forEachWhileArray: <In, E, R>(f: (input: NonEmptyReadonlyArray<In>) => Effect.Effect<boolean, E, R>) => Sink<void, In, never, E, R>

Source

Since v4.0.0