Visualizing Observables

You’re about to learn some of the operators that we’ll use most frequently in our RxJS programs. Talking about what operators do to a sequence can feel abstract. To help developers understand operators in an easy way, we’ll use a standard visual representation for sequences, called marble diagrams. They visually represent asynchronous data streams, and you will find them in every resource for RxJS.

Let’s take the range operator, which returns an Observable that emits integers within a specified range: Rx.Observable.range(1, 3);

The marble diagram for it looks like this:

images/ch3_marble_range.png

The long arrow represents the Observable, and ...

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.