SwitchMap related articles
- SwitchMap Operators in RXJS
- Through an example of RXJS, to learn how to use SwitchMap
- Implementation principle of RXJS switchMap
- Application of RXJS map and switchMap in SAP Spartacus – flatten high order Observables
Type Observable<Observable> is not assignable to type Observable.
Look at this line of code:
quantity$: Observable<number> = this.product$.pipe(map(product= > this.cartService.getEntry(product.code));
Copy the code
The returned parameter type is Observable<Observable>.
A nested Observable can be flattened using a switchMap, so the switchMap is also called a flatten operator.
For more of Jerry’s original articles, please follow the public account “Wang Zixi “: