- Preparing search index...
- The search index is not available
@giraugh/tools
- mapAsync<TFrom, TTo>(array, asyncMapFn): Promise<TTo[]>
-
Parameters
-
array: TFrom[]
-
asyncMapFn: ((value, i, arr) => Promise<TTo>)
-
- (value, i, arr): Promise<TTo>
-
Parameters
-
value: TFrom
-
i: number
-
arr: TFrom[]
Returns Promise<TTo>
Returns Promise<TTo[]>
Map an array in parallel using an async mapping function.
Returns
a promise of the mapped array. it will resolve when all of the elements resolve
Example