Skip to content

map

Map an array with an async function

124 bytes

Usage

A map that handles callback functions that return a promise.

import * as _ from 'radashi'
const userIds = [1, 2, 3, 4]
const users = await _.map(userIds, async userId => {
return await api.users.find(userId)
})