January 2019
Beginner
210 pages
4h 47m
English
The map operator function can be used to transform the values in an observable into derived values:
import { from } from "rxjs";import { map } from "rxjs/operators";const observable = from<number>([1, 2, 3]);observable.pipe(map(x => 10 * x));const subscription = observable.subscribe( (value) => console.log(value));subscription.unsubscribe();
The preceding code snippet uses the map operator to transform the values in an observable into new values (the original value multiplied by ten). The following marble diagram showcases the initial sequence and the result sequence after applying the map operator:

The result sequence contains a new mapped ...
Read now
Unlock full access