Skip to content

bubblydoo/wait-until-generalized

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

waitUntil generalized

waitUntil for usage outside of Service/Cloudflare Workers.

npm i wait-until-generalized
import { WaitUntilList } from 'wait-until-generalized';

const { waitUntil, waitUntilSettled } = new WaitUntilList();

const delay = (ms) => new Promise((res) => setTimeout(res, ms));

waitUntil(delay(1000).then(() => {
  console.log('Waited one second');
  waitUntil(delay(1000).then(() => {
    console.log('Waited another second');
  }));
}));

const results = await waitUntilSettled();

results.length // -> 2

About

`waitUntil` generalized

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published