Created
February 13, 2011 06:08
-
-
Save marcello3d/824489 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 complete(x,value) { | |
var values = arguments.callee.values; | |
values[x] = value; | |
if (++arguments.callee.completed < 2) return; | |
// do whatever with values | |
} | |
asyncOp("foo", function(err,data) { complete("foo",data); }) | |
asyncOp("bar", function(err,data) { complete("bar",data); }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment