@epikodelabs/streamix / skipWhile
Function: skipWhile()
skipWhile<
T>(predicate):Operator<T,T>
Defined in: projects/libraries/streamix/src/lib/operators/skipWhile.ts:17
Creates a stream operator that skips values from the source stream while a predicate returns true.
This operator is a powerful filtering tool for removing a contiguous prefix of a stream. It consumes values from the source and applies the predicate function to each one. As long as the predicate returns true, the values are ignored. As soon as the predicate returns false for the first time, this operator begins to emit that value and all subsequent values from the source, regardless of whether they satisfy the predicate.
Type Parameters
T
T = any
The type of the values in the source and output streams.
Parameters
predicate
(value, index) => MaybePromise<boolean>
The function to test each value. Receives the value and its index. true means to continue skipping, and false means to stop skipping and begin emitting.
Returns
Operator<T, T>
An Operator instance that can be used in a stream's pipe method.