mapAsync
mapAsync<
T,R>(iterable,mapper):AsyncIterableIterator<R>
Defined in: packages/core/src/iterable/async/map.ts:15
Yields mapper(element) for each element, lazily.
The async counterpart of map.
Time complexity: O(1) per element, plus whatever mapper costs.
Type Parameters
Section titled “Type Parameters”T
R
Parameters
Section titled “Parameters”iterable
Section titled “iterable”The input iterable, sync or async.
mapper
Section titled “mapper”MaybeAsyncCallable<[T, number], R>
Receives each element and its zero-based index.
Returns
Section titled “Returns”AsyncIterableIterator<R>
An iterator over the mapped values.