Debugging an Observable Stream

This inner observable keeps things simple when it comes to managing the split data, but it creates a bit of a mess in the middle of our previously-debuggable observable flow. Debugging was easy when there was only one observable—just add .subscribe(console.log) at the point of contention and comment out the rest. Now there are mutliple observable chains kicking around (and one of them doesn’t even have an explicit subscribe). How can we peek into a running observable chain to see what’s going on?

Enter the tap operator. This operator does not modify any of the in-flight data or observables surounding it. Instead, it allows us to peek into what’s going on inside the stream, observing the data, but not manipulating ...

Get Build Reactive Websites 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.