Function chain

  • Chain the argument iterator after the incoming iterator.

    It will also work when one iterator is synchronous and the other one is asynchronous!

    Example

    const chained = pipe(
    itr8Range(1, 3),
    chain(itr8Range(4, 6))
    );

    // chained yields: 1, 2, 3, 4, 5, 6

    Returns

    An iterator that yields all values from the first iterator, then all values from the second iterator

    Type Parameters

    • TIn

    Parameters

    • secondIterator: Iterator<TIn, any, undefined> | AsyncIterator<TIn, any, undefined>

      The iterator to chain after the incoming iterator

    Returns ((firstIterator: Iterator<TIn, any, undefined> | AsyncIterator<TIn, any, undefined>) => IterableIterator<TIn> | AsyncIterableIterator<TIn>)

      • (firstIterator: Iterator<TIn, any, undefined> | AsyncIterator<TIn, any, undefined>): IterableIterator<TIn> | AsyncIterableIterator<TIn>
      • Parameters

        • firstIterator: Iterator<TIn, any, undefined> | AsyncIterator<TIn, any, undefined>

        Returns IterableIterator<TIn> | AsyncIterableIterator<TIn>

Generated using TypeDoc