var Observable = Rx.Observable; // Nested SwitchLatest/SwitchMap BROKEN? // Expecting: "A", "B" (with synchronous scheduler/execution) // Observed: "B" Observable.of( Observable.of('A').switchMap(function(o) { return Observable.of(o); }), Observable.of('B') ). switchLatest(). forEach(function(o){ console.log(o); }); // Expecting: "A", "B" (with synchronous scheduler/execution) // Observed: "B" Observable.of( Observable.of('A').switchMap(function(o) { return Observable.of(o); }), Observable.of('B').switchMap(function(o) { return Observable.of(o); }) ). switchLatest(). forEach(function(o){ console.log(o); }); // Expecting: "A", "B", "C" (with synchronous scheduler/execution) // Observed: "C" Observable.of( Observable.of('A').switchMap(function(o) { return Observable.of(o); }), Observable.of('B').switchMap(function(o) { return Observable.of(o); }), Observable.of('C').switchMap(function(o) { return Observable.of(o); }) ). switchLatest(). forEach(function(o){ console.log(o); }); // 'WORKING' VARIANTS // Expecting: "B", "A" // Observed: "B", "A" Observable.of( Observable.of('B'), Observable.of('A').switchMap(function(o) { return Observable.of(o); }) ). switchLatest(). forEach(function(o){ console.log(o); }); // Expecting: "A" // Observed: "A" Observable.of( Observable.of('A').switchMap(function(o) { return Observable.of(o); }) ). switchLatest(). forEach(function(o){ console.log(o); }); // Expecting: "A" // Observed: "A" Observable.of('A').switchMap(function(o) { return Observable.of(o); }). forEach(function(o){ console.log(o); }); // Expecting: Two Observables On Nexted // Observed: Two Observables On Nexted Observable.of( Observable.of('A').switchMap(function(o) { return Observable.of(o); }), Observable.of('B').switchMap(function(o) { return Observable.of(o); }) ). // switchLatest(). removed forEach(function(o){ console.log(o); });