There is many operators available, and in order to understand them we need to has a simple-to-the-communicating how they Transform a source Observable into a result of Observable over time. Throughout this course we is going to see the so-called marble diagrams.
varFoo = Rx.Observable.interval (1000);/*foo:---0---1---2---3--... multiplyby (2) Bar:---0---2---4---6--...*/functionmultiplyby (multiplier) {varSource = This; varresult = Rx.Observable.create (functionSubscribe (Observer) {Source.subscribe (function(x) {Observer.next (x *multiplier); }, function(Err) {observer.error (err);},function() {observer.complete ();} ); }); returnresult;} Rx.Observable.prototype.multiplyBy=multiplyby;varBar = Foo.multiplyby (2); Bar.subscribe (function(x) {Console.log (' next ' +x); }, function(ERR) {console.log (' error ' +err); }, function() {console.log (' done ')); },);
[RxJS] Marble diagrams in ASCII form