Skip to content

Instantly share code, notes, and snippets.

@pzuraq
Created January 4, 2014 20:00
Show Gist options
  • Save pzuraq/8259945 to your computer and use it in GitHub Desktop.
Save pzuraq/8259945 to your computer and use it in GitHub Desktop.
var promises = [
Q.nfcall(db.query, args)
];
if (condition) {
promises.push(Q.nfcall(db.query, args2));
}
Q.all(promises).then(function() {
/* yay callback */
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment