Created
October 12, 2017 20:20
-
-
Save Rebolon/18256816554392f03322ebe44fbb656b to your computer and use it in GitHub Desktop.
Fetch API with Rxjs and their Observable
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
const uri = 'https://ghibliapi.herokuapp.com/films' | |
Rx.Observable | |
.fromPromise( | |
fetch(uri) | |
) | |
.flatMap(res => res.json()) | |
.subscribe(res => console.log(res)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment