Created
June 2, 2011 19:13
-
-
Save apanda/1005080 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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