Skip to content

Instantly share code, notes, and snippets.

@huang47
Created May 5, 2015 19:08
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 huang47/c61c8a3f3d3336f9d0ee to your computer and use it in GitHub Desktop.
Save huang47/c61c8a3f3d3336f9d0ee to your computer and use it in GitHub Desktop.
var Rx = require('rx');
var s1 = new Rx.Subject();
var s2 = new Rx.Subject();
var s3 = new Rx.Subject();
Rx.Observable.merge(s1, s2, s3).
forEach(
console.log.bind(console, 'next'),
console.log.bind(console, 'error'),
console.log.bind(console, 'complete')
);
s1.onNext(1);
s2.onCompleted(1);
s3.onCompleted(1);
s1.onCompleted(1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment