Skip to content

Instantly share code, notes, and snippets.

@Rebolon
Created October 12, 2017 20:20
Show Gist options
  • Save Rebolon/18256816554392f03322ebe44fbb656b to your computer and use it in GitHub Desktop.
Save Rebolon/18256816554392f03322ebe44fbb656b to your computer and use it in GitHub Desktop.
Fetch API with Rxjs and their Observable
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