cycleAsync
cycleAsync<
T>(iterable,times?):AsyncIterableIterator<T>
Defined in: packages/core/src/iterable/async/cycle.ts:19
Yields the whole iterable times times over.
The async counterpart of cycle. The source is pulled once and buffered,
because an iterator cannot be restarted, so the whole of it is held in memory
from the first pass onwards. Later passes yield from the buffer and never
await.
Time complexity: O(n × times). Memory: O(n).
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”iterable
Section titled “iterable”The input iterable, sync or async.
times?
Section titled “times?”number = Number.POSITIVE_INFINITY
How many passes to yield. Must be a non-negative integer or
Infinity, which repeats forever.
Returns
Section titled “Returns”AsyncIterableIterator<T>
An iterator over the repeated elements.
Throws
Section titled “Throws”If times is negative, fractional or NaN.