January 2019
Beginner
210 pages
4h 47m
English
The zip operator function can be used to merge the values of two observables into value pairs:
import { from } from "rxjs";import { zip } from "rxjs/operators";const observableA = from<number>([1, 2, 3, 3, 4, 5]);const observableB = from<string>(["A", "B", "C", "D"]);const observableC = observableA.pipe(zip<number, string>(observableB));const subscription = observableC.subscribe( (value) => console.log(value));subscription.unsubscribe();
The preceding code snippet uses the zip operator to combine the values of two observables into a new observable. The values in the new observable are value pairs that contain a value from the first observable and a value from the second observable and are grouped by their index in the sequence. The following ...
Read now
Unlock full access