Skip to content

erikpukinskis/global-wait

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!")
})

About

wait for things to finish in other modules and other iframes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published