Chapter 5Bending Time with Schedulers

As soon as I discovered RxJS, I started using it in my projects. For a while I thought I knew how to use it effectively, but there was a nagging question: how do I know whether the operator I’m using is synchronous or asynchronous? In other words, when exactly do operators emit notifications? This seemed a crucial part of using RxJS correctly, but it felt a bit blurry to me.

The interval operator, I thought, is clearly asynchronous, so it must use something like setTimeout internally to emit items. But what if I’m using range? Does it emit asynchronously as well? Does it block the event loop? What about from? I was using these operators everywhere, but I didn’t know much about their internal concurrency ...

Get Reactive Programming with RxJS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.