Skip to content

Instantly share code, notes, and snippets.

@apanda
Created June 2, 2011 19:13
Show Gist options
  • Save apanda/1005080 to your computer and use it in GitHub Desktop.
Save apanda/1005080 to your computer and use it in GitHub Desktop.
function join(f1, f2) {
return function (callback) {
var doneOnce = false;
f1(function () {
if (doneOnce)
{
callback();
}
doneOnce = true;});
f2(function () {
if (doneOnce)
{
callback();
}
doneOnce = true;});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment