Function toArray

  • Converts the input iterable to an array. Returns a function that accepts an input iterable and returns a promise resolving to an array of the elements from the input iterable.

    Returns

    A function that accepts an input iterable and returns a promise resolving to an array.

    Example

    const input = asyncIterable([1, 2, 3, 4, 5]);
    const result = await toArray()(input); // [1, 2, 3, 4, 5]

    Type Parameters

    • T

      The type of elements in the input iterable.

    Returns ((input: AnyIterable<T>) => Promise<T[]>)

Generated using TypeDoc