rxjs of synchronised by default

Posted on May 27, 2019

As mentioned here if you use of from rxjs to implement mock services you can get some unexpected results. In my case, my code always cleans up its subscriptions. But, by default, of executes synchronously, so the following code will fail because sub isn’t set when the closure is called.

In order to get this code to behave like a the real service we need to use a scheduler.