@astrocoders/waterfall

1.0.2 • Public • Published

Waterfall

This function receives an array of promises and resolves all them one by one when the execution of this function finish all promises passed will be resolved. This is more performative than Promise.all when you need to wait for a big array of promises.

Install

yarn add @astrocoders/waterfall

Usage

import waterfall from '@astrocoders/waterfall'

const result = await waterfall(
	list.map(item => async () => {
		return new Promise((resolve, reject) => resolve(item * 2))
	}
)

Readme

Keywords

none

Package Sidebar

Install

npm i @astrocoders/waterfall

Weekly Downloads

3

Version

1.0.2

License

MIT

Unpacked Size

2.49 kB

Total Files

5

Last publish

Collaborators

  • luizmoratelli
  • yurijean
  • lucasbesen
  • eliabejr
  • medson10
  • gabrielrubens
  • georgelima
  • guilhermedecampo