Basic Sequence Operators

Among the dozens of operators that transform Observables in RxJS, the most used are those that any language with decent collection-processing abilities also have: map, filter, and reduce. In JavaScript, you can find these operators in Array instances.

RxJS follows JavaScript conventions, so you’ll find that the syntax for the following operators is almost the same as for array operators. In fact, we’ll show the implementation using both arrays and Observables to show how similar the two APIs are.

Map

map is the sequence transformation operator most used. It takes an Observable and a function and applies that function to each of the values in the source Observable. It returns a new Observable with the transformed values. ...

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.