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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access