effect-io-ai

Package: effect
Module: Stream

Stream.takeWhileFilter

Takes the longest initial prefix accepted by a Filter and emits the filter’s success values.

When to use

Use to keep the leading stream elements that a Filter accepts, emit the filter’s success values, and stop at the first filter failure.

Details

The stream stops at the first Result.fail returned by the filter.

See

Signature

declare const takeWhileFilter: { <A, B, X>(f: Filter.Filter<NoInfer<A>, B, X>): <E, R>(self: Stream<A, E, R>) => Stream<B, E, R>; <A, E, R, B, X>(self: Stream<A, E, R>, f: Filter.Filter<NoInfer<A>, B, X>): Stream<B, E, R>; }

Source

Since v4.0.0