Created
September 24, 2014 06:03
-
-
Save laser/28dc20b8d1191e6683b0 to your computer and use it in GitHub Desktop.
error / stream composition
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
var streamA = Bacon.fromNodeCallback(client, 'get', 'foo'); | |
var streamB = streamA.flatMap(function(foo) { | |
return Bacon.fromNodeCallback(client, 'post', 'bar', { data: foo }); | |
}); | |
streamB.onError(function(err) { | |
throw err; // error from either the GET or the POST | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment