Skip to content

dropWhileAsync

dropWhileAsync<T>(iterable, predicate): AsyncIterableIterator<T>

Defined in: packages/core/src/iterable/async/drop-while.ts:18

Skips elements from the start for as long as predicate holds, then yields everything from the first rejected element onwards.

The async counterpart of dropWhile. The predicate is not consulted again once it has rejected.

Time complexity: O(1) per element.

T

MaybeAsyncIterable<T>

The input iterable, sync or async.

MaybeAsyncPredicate<[T, number]>

Receives each element and its zero-based index. Skipping stops the first time it resolves false.

AsyncIterableIterator<T>

An iterator over the elements from the first rejection onwards.