https://github.com/bcherny/mapf
Ergonomic Promise.all
https://github.com/bcherny/mapf
async functional-programming typescript
Last synced: 8 months ago
JSON representation
Ergonomic Promise.all
- Host: GitHub
- URL: https://github.com/bcherny/mapf
- Owner: bcherny
- License: mit
- Created: 2017-01-13T23:45:05.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-31T21:47:11.000Z (almost 9 years ago)
- Last Synced: 2024-12-17T03:03:24.513Z (11 months ago)
- Topics: async, functional-programming, typescript
- Language: TypeScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# mapf [](https://circleci.com/gh/bcherny/mapf) [](https://www.npmjs.com/package/mapf) [](https://opensource.org/licenses/MIT)
> Ergonomic `Promise.all`
## Installation
```sh
npm install mapf --save
```
## Usage
```js
import { mapf } from 'mapf'
const [a, b, c] = await mapf([1, 2, 3], async _ => await foo(_))
```
## Rationale
```js
// 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
```sh
npm test
```
## License
MIT