-
-
Save ry/249750 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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