An iterable implementing push iteration protocol.

Type Parameters

  • T

    Iterated elements type.

Hierarchy

Methods

  • Iterates over elements of this push iterable.

    Calls accept method for each iterated element until there are elements to iterate, or accept returned either true or false.

    Calling this method with accept parameter is a faster alternative to creating a push iterator and iterating with it.

    Calling this method without arguments is the same as calling [Symbol.iterator]() one.

    Parameters

    • Optional accept: Acceptor<T>

      A function to push iterated elements to. Accepts iterated element as its only parameter. May return true to suspend iteration, or false to stop it.

    • Optional mode: PushIterationMode

      Optional iteration mode hint declaring what accept function shall do. Ignored without accept parameter.

    Returns PushIterator<T>

    A push iterator instance to continue iteration with. If accept returned false then further iteration won't be possible with returned iterator.

Generated using TypeDoc