effect-io-ai

Package: effect
Module: Sink

Sink.takeWhileFilter

Applies a Filter to input elements while it succeeds, collecting each successful output.

Details

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

Signature

declare const takeWhileFilter: <In, Out, X>(filter: Filter.Filter<In, Out, X>) => Sink<Array<Out>, In, In>

Source

Since v4.0.0