Created
October 5, 2016 22:47
-
-
Save oddlyfunctional/8a02f8f9f5b8109224ec103d4e3d2a50 to your computer and use it in GitHub Desktop.
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
http.get('/first_resource') | |
.map(response => response.json()) | |
.flatMap(firstResource => { | |
if (firstResource.someProperty) { | |
return http.get(`/first_resource/${firstResource.id}/second_resource`); | |
} else { | |
return Observable.never(); | |
} | |
}).subscribe(handleSecondaryResource); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment