Created
November 15, 2014 15:10
-
-
Save OliverJAsh/a63a7572b2cb36046d5c to your computer and use it in GitHub Desktop.
This file contains 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
/* jshint esnext: true */ | |
// `getStream` is some third party thing | |
var stream = getStream(); | |
var events = Rx.fromEvent(stream, 'meta'); | |
stream.write('foo'); | |
// meta event fired by `stream` | |
stream.write(null); | |
// When subscribing to the observable, RxJS *then* starts listening for the | |
// `meta` event – but it's too late because the event has already been fired! | |
events.subscribe(x => console.log(x)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment