mapf
v1.0.3
Published
Ergonomic Promise.all
Downloads
6
Readme
mapf
Ergonomic
Promise.all
Installation
npm install mapf --save
Usage
import { mapf } from 'mapf'
const [a, b, c] = await mapf([1, 2, 3], async _ => await foo(_))
Rationale
// before
const [a, b, c] = await Promise.all([1, 2, 3].map(async _ => await foo(_)))
// after
const [a, b, c] = await mapf([1, 2, 3], async _ => await foo(_)))
Tests
npm test
License
MIT