Skip to content

Day 05 Rxjs Operators

Kobi Hari edited this page Jun 28, 2021 · 4 revisions

Day 05 - RxJS Operators

Projects

rxjs-colors Colors search engine using rxjs operators
ex4-solution Solution to exercise 4

Introduction to RxJS operators

Colors Search app using rx operators

  • We created an example that uses observable to convert color search keyword into a list of matching results (colors)
  • We Understood that the map operator cannot be used when we apply an asyncronous function on each event because it creates an Observable of Promises
  • We saw how to use mergeMap and switchMap as asynchronous alternative for map when using async projections
    • mergeMap(x => observable) is actually short for map(x => observable), mergeAll()
    • switchMap(x => observable) is actually short for map(x => observable), switchAll()
  • We understood the difference between mergeMap and switchMap