In some situations it is beneficial to force an observable to resolve subscriptions asynchronously, via use of the observeOn
operator. Failing that, it is at least possible to force an observable to resolve asynchronously. The issue from an Angular perspective is that we usually want our subscribe
callback to run in the Angular zone, otherwise change detection won't automatically kick off. Additionally, inside an asynchronous observer callback setTimeout
does not run in the app zone, eliminating a potentially obvious solution. To code defensively, one might use NgZone.run
wherever there's a possibility that an observable is async. Unfortunately, this has the knock-on effect of causing errors if the observable is not async. To prevent those errors observables can be uniformly forced async, with NgZone
used in the subscribe callback, resulting in uniform, proper behaviour. These measures have a not insubstantial technical cost.
I am not presently aware of a way to ensure that cal