iter-fns - v0.13.0
    Preparing search index...

    Function tee

    • Creates two independent iterators from a single iterator.

      The iterator that was passed in should not be used, as it will be in an undefined state once iteration of any teed iterators begin.

      Type Parameters

      • T

        type of the items

      Parameters

      Returns [Iterator<T>, Iterator<T>]

    • Creates multiple independent iterators from a single iterator.

      The iterator that was passed in should not be used, as it will be in an undefined state once iteration of any teed iterators begin.

      Type Parameters

      • T

        type of the items

      • N extends number

        the number of independent iterators to create

      Parameters

      • it: Iterator<T>

        the iterator

      • n: N

        the number of independent iterators to create

      Returns Tuple<Iterator<T>, N>

    • Creates multiple independent iterators from a single iterator.

      The iterator that was passed in should not be used, as it will be in an undefined state once iteration of any teed iterators begin.

      Type Parameters

      • T

        type of the items

      Parameters

      • it: Iterator<T>

        the iterator

      • Optionaln: number

        the number of independent iterators to create

      Returns Iterator<T>[]