Last active
March 22, 2020 20:10
-
-
Save NyaGarcia/4c0c5476d67d6e363584c00266c3dcd1 to your computer and use it in GitHub Desktop.
Fixing nested subscribes with the switchMap operator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| getTrainer() | |
| .pipe( | |
| switchMap(trainer => getStarterPokemon(trainer)) | |
| ) | |
| .subscribe(pokemon => { | |
| // Do stuff with pokemon | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment