yta
    Preparing search index...

    Function toArray

    • Collect the iterator into a promise of an array.

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

      await pipe(range(5), asAsync(), toArray());
      // => [0, 1, 2, 3, 4]

      Type Parameters

      • A

      Returns (items: AsyncIterable<A>) => Promise<A[]>