Function concat

  • Merges current iterable with any combination of values, iterators or iterables. Merged inputs are iterated over after depleting the current iterable, in the order in which they were specified, i.e. the standard Array.concat logic.

    import {pipe, concat} from 'iter-ops';

    const i = pipe(
    [1, 2],
    concat(3, 4, [5, 6])
    );

    console.log(...i); //=> 1 2 3 4 5 6

    Note that if you concatenate asynchronous iterables inside a synchronous pipeline, they will be processed as simple values.

    Type Parameters

    • T
    • Vs extends readonly unknown[]

    Parameters

    • Rest...values: Vs

    Returns Operation<T, T | (Vs[number] extends UnknownIterableOrIterator<infer U>
        ? U
        : never)>