Skip to content

Instantly share code, notes, and snippets.

@realyze
Last active August 29, 2015 14:03
Show Gist options
  • Save realyze/322098d21920b2363053 to your computer and use it in GitHub Desktop.
Save realyze/322098d21920b2363053 to your computer and use it in GitHub Desktop.
qLine1 = promisifiedQueryDB('SQL HERE')
qLine1.then(function(line1) {
var promises = []
line1.lines.forEach(function(line2) {
promises.push(promisifiedQueryDB('SQL query for each line2 HERE'));
});
return Q.all(promises)
})
.then(function(arrayOfPromisesForLine2Results) {
...
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment