Created
April 17, 2020 21:10
-
-
Save NyaGarcia/22d31ea2007dd8228b39e9aea17623e1 to your computer and use it in GitHub Desktop.
Observable created with ajax, data fetched with getJSON
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
import { ajax } from "rxjs/ajax"; | |
// Observable will only emit the response data | |
const ghibliFilm$ = ajax.getJSON("https://ghibliapi.herokuapp.com/films"); | |
ghibliFilm$.subscribe(films => console.log(films)); | |
// Output: [Object, Object, Object...] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment