RxJS 6 examples in Angular 6 – Transformation Operators

Some more RxJS 6 examples in Angular 6. Each example follows the new Angular 6 RxJS 6 coding styles so they are tree-shakable and future-proof.

 

map = how to transform values

The “map” operator transforms one value to another. e.g. map(x => x * 10).

Try out the example on StackBlitz.

 

reduce – How to aggrevate values e.g. 1 + 2 + 3 = 6

The “reduce” operator aggregates the values emitted by an observable. e.g. reduce((acc, curr) => acc + curr, 0).

Try out the example on StackBlitz.

 

Other articles in this series

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.