Maps over an array with an async function, resolving all promises concurrently. Similar to Promise.all(array.map(...)).
const fetchUser = (id: number) => fetch(`/api/users/${id}`);await asyncMap(fetchUser)([1, 2, 3]);// => [User, User, User] Copy
const fetchUser = (id: number) => fetch(`/api/users/${id}`);await asyncMap(fetchUser)([1, 2, 3]);// => [User, User, User]
Input element type
Output element type
Async function to apply to each element
Promise resolving to array of mapped values
Maps over an array with an async function, resolving all promises concurrently. Similar to Promise.all(array.map(...)).
Example