Skip to content

Instantly share code, notes, and snippets.

@ry
Forked from felixge/gist:249748
Created December 5, 2009 16:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ry/249750 to your computer and use it in GitHub Desktop.
Save ry/249750 to your computer and use it in GitHub Desktop.
db.query('SELECT 1')
('result1', function(result1) {
return db.query('SELECT 2');
})
('result2', function(result2) {
return db.query('SELECT 3');
})
('result3')
.addCallback(function(results) {
p(results); // == {result1: result1, result2: result2, result3: result}
})
.addErrback(function() {
// If anything goes wrong in this chain, catch it here!
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment