Skip to content

Instantly share code, notes, and snippets.

@marcello3d
Created February 13, 2011 06:08
Show Gist options
  • Save marcello3d/824489 to your computer and use it in GitHub Desktop.
Save marcello3d/824489 to your computer and use it in GitHub Desktop.
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