The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Flatten a higher order observable with RxJS switch

Flatten a higher order observable with RxJS switch

4:52
To consume the higher order RxJS Observable, we had to do a subscribe inside a subscribe. In this lesson, we will learn a better approach using flattening operators, of which switch() is a common and simple one.
Watch this lesson now
Avatar
egghead.io

To consume the higher order RxJS Observable, we had to do a subscribe inside a subscribe. In this lesson, we will learn a better approach using flattening operators, of which switch() is a common and simple one.

Avatar
Rene

Is there any way you can include examples with real data?

Avatar
Andre

Hi Rene. Yes, keep on watching the course and in the 5th lesson from now, there is a real-world example for HTTP requests with switch().

In reply to Rene
Avatar
Scott

Why is it called switch? It looks like it just flattens.

In reply to Andre
Avatar
Andre

Hi Scott. It performs flattening, and it's called switch because it is one of the flattening strategies, to "switch from the previous inner Observable to the next inner one".

In reply to Scott
HEY, QUICK QUESTION!
Joel's Head
Why are we asking?