Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

import { map, catchError } from 'rxjs/operators';

of(2, 4, 6)
.pipe(
map(item => item * 2),
tap(item => console.log(item))
);
import { combineLatest, of } from 'rxjs';

import { combineLatest } from 'rxjs/operators';


tap
tap(data => console.log(JSON.stringify(data)))
-
-
-
-

-
- combineLatest
- forkJoin
- withLatestFrom
Subject

BehaviorSubject
- forkJoin
- toArray

this.selectedProduct$
.pipe(
switchMap(selectedProduct =>
from(selectedProduct.supplierIds)
.pipe(
mergeMap(id => this.http.get<Supplier>(`${this.url}/${id}`)),
toArray()
)));
• •

• •

products$ = this.http.get<Product[]>(url) productSubject = new Subject<number>();


.subscribe(); this.productSubject.next(12)
-
-
-
-

You might also like