Function concat

  • Concatenates multiple input iterables into a single asynchronous iterable.

    Returns

    A function that accepts an input iterable and returns a concatenated asynchronous iterable.

    Example

    const input1 = [1, 2, 3];
    const input2 = [4, 5, 6];
    const concatenatedIterable = concat<number>(input2)(input1);

    (async () => {
    for await (const x of concatenatedIterable) {
    console.log(x); // Logs 1, 2, 3, 4, 5, 6
    }
    })();

    Type Parameters

    • T

      The type of elements in the input iterables.

    Parameters

    • Rest ...iterables: AnyIterable<T>[]

      The iterables to concatenate.

    Returns ((input: AnyIterable<T>) => AsyncIterable<Awaited<T>>)

      • (input: AnyIterable<T>): AsyncIterable<Awaited<T>>
      • Parameters

        Returns AsyncIterable<Awaited<T>>

Generated using TypeDoc