Skip to content

Instantly share code, notes, and snippets.

@NyaGarcia
Created April 17, 2020 21:04
Show Gist options
  • Save NyaGarcia/1a3d806aea24f78b52a12708f611ecc8 to your computer and use it in GitHub Desktop.
Save NyaGarcia/1a3d806aea24f78b52a12708f611ecc8 to your computer and use it in GitHub Desktop.
Observable created with ajax()
import { ajax } from "rxjs/ajax";
// Observable will emit the entire AjaxResponse object
const ghibliFilmsResponse$ = ajax("https://ghibliapi.herokuapp.com/films");
ghibliFilmsResponse$.subscribe(console.log);
// Output: AjaxResponse {xhr: {}, request: {}...}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment