takeWhileInclusiveAsync
takeWhileInclusiveAsync<
T>(iterable,predicate):AsyncIterableIterator<T>
Defined in: packages/core/src/iterable/async/take-while-inclusive.ts:19
Yields elements for as long as predicate holds, including the first one
that fails it.
The async counterpart of takeWhileInclusive, and one of the two cases
takeWhileAsync gets wrong: it consumes the failing element and discards it,
which loses a terminator a caller needs.
Time complexity: O(1) per element, over the prefix only.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”iterable
Section titled “iterable”The input iterable, sync or async.
predicate
Section titled “predicate”MaybeAsyncPredicate<[T, number]>
Receives each element and its zero-based index. The first element it rejects is yielded, and iteration stops after it.
Returns
Section titled “Returns”AsyncIterableIterator<T>
An iterator over the prefix, terminator included.