mapf

Ergonomic Promise.all

Usage no npm install needed!

<script type="module">
  import mapf from 'https://cdn.skypack.dev/mapf';
</script>

README

mapf Build Status NPM MIT

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