Class: Map

rg-async. Map

Defines a Map class. Provides two methods (map that will run in parallel and mapSeries that will run in series).


new Map()

Author:
Source:

Methods


<static> map(srcArray, mapper)

Invokes in parallel an async mapper function on each item in the given source Array.

Invokes in parallel an async mapper function on each item in the given source Array. This will return a promise to be resolved containing the new array with the mapped/transformed items.

Parameters:
Name Type Description
srcArray Array

Specifies the source array to map over.

mapper function

Specifies the async function that will be called with (value, index, array) as arguments and returns the new mapped value.

Source:
Returns:

Returns a promise to be resolved containing the new array with the mapped/transformed items.

Type
Promise