@highoutput/async-group
TypeScript icon, indicating that this package has built-in type declarations

0.5.0 • Public • Published

async-group

Groups together multiple promises and allows to 'wait' for all of them to settle.

Usage

import delay from '@highoutput/delay';
import AsyncGroup from '@highoutput/async-group';

AsyncGroup.add(delay('2s'));
AsyncGroup.add(delay('3s'));

const timestamp = process.hrtime();
AsyncGroup.wait().then(() => console.log(process.hrtime(timestamp).shift())); // 5

delay('1s').then(() => AsyncGroup.add(delay('4s')));

Readme

Keywords

none

Package Sidebar

Install

npm i @highoutput/async-group

Weekly Downloads

7

Version

0.5.0

License

ISC

Unpacked Size

7.37 kB

Total Files

11

Last publish

Collaborators

  • ccpacillos
  • rrmadjos
  • glvnzn
  • highoutputventures
  • highoutputdev