I would expect that the following code would run asynchronously:
var range = Rx.Observable.range(0, 3000000);
range.subscribe(
function(x) {},
function(err) {},
function() {
console.log('Completed');
});
console.log('Hello World');
But that's not the case. It takes a while to go through the big range of numbers and only when it is completed the execution is resumed, you can try the code here.
I am confused as to when to expect RxJS to behave synchronously or asynchronously. Does it depend on the method used? My previous idea was that once we are in Observables/Observer land, everything in it runs asynchronously, similar to how promises work.