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 = waitstart"pack up"
Then various people can wait for things to finish:
When you are done with your ticket, mark it finished:
wait
And then your callback will be called:
{ console}
If you want to wait on things to be finished in a different iframe:
wait