yta
    Preparing search index...

    Function dropWhile

    • Drop every item from the iterator while the predicate function holds true, after that every item is emitted.

      import { pipe } from "yta";
      import { dropWhile, toArray } from "yta/async";
      import { asAsync, range } from "yta/sync";

      await pipe(
      range(10),
      asAsync(),
      dropWhile((n) => n < 5),
      toArray(),
      );
      // => [5, 6, 7, 8, 9]

      See also:

      Type Parameters

      • A

        The item type

      Parameters

      • p: (item: A) => boolean

        The predicate function

      Returns (items: AsyncIterable<A>) => AsyncGenerator<A, void>