global-wait

0.18.0 • Public • Published

If you want to start multiple asynchronous processes from different places and then wait for them all to finish, global-wait can help.

Create a ticket that everyone else will wait on:

var ticket = wait.start("pack up")

Then various people can wait for things to finish:

wait(dontStray)

When you are done with your ticket, mark it finished:

wait.finish(ticket)

And then your callback will be called:

function dontStray() {
  console.log("They don't love you like i love you.")
}

If you want to wait on things to be finished in a different iframe:

 
wait.forIframe(".my-iframe", function() {
  console.log("my frame finished!")
})

Readme

Keywords

none

Package Sidebar

Install

npm i global-wait

Weekly Downloads

3

Version

0.18.0

License

ISC

Unpacked Size

6.41 kB

Total Files

4

Last publish

Collaborators

  • erikpukinskis