takeAsync
takeAsync<
T>(iterable,count):AsyncIterableIterator<T>
Defined in: packages/core/src/iterable/async/take.ts:16
Yields at most the first count elements, then stops.
The async counterpart of take. The source is closed as soon as the quota is
met, so taking from an endless stream terminates.
Time complexity: O(count).
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”iterable
Section titled “iterable”The input iterable, sync or async.
number
How many elements to yield. Must be a non-negative integer.
Returns
Section titled “Returns”AsyncIterableIterator<T>
An iterator over the leading elements.
Throws
Section titled “Throws”If count is not a non-negative integer.