markEndsAsync
markEndsAsync<
T>(iterable):AsyncIterableIterator<MarkedEnd<T>>
Defined in: packages/core/src/iterable/async/mark-ends.ts:19
Yields each element tagged with whether it is the first and whether it is the last.
The async counterpart of markEnds. Knowing an element is the last one
requires a one-element lookahead, so the source always runs one step ahead of
what has been yielded — on a slow stream that means one extra pending read at
all times.
Time complexity: O(1) per element, allocating one tuple per yield.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”iterable
Section titled “iterable”The input iterable, sync or async.
Returns
Section titled “Returns”AsyncIterableIterator<MarkedEnd<T>>
An iterator over the tagged elements.