Skip to content

Instantly share code, notes, and snippets.

@IEvangelist
Created September 2, 2016 01:35
Show Gist options
  • Save IEvangelist/13ea00dd35513834b4763a188e42ca43 to your computer and use it in GitHub Desktop.
Save IEvangelist/13ea00dd35513834b4763a188e42ca43 to your computer and use it in GitHub Desktop.
// If this call fails, we'll try it again with the same payload two times
getFooBars(onNext: (fooBars: FooBar[]) => void) {
this.get("api/foobar")
.map(response => <FooBar[]>response.json())
.retry(2)
.subscribe(onNext,
error =>
console.log("An error occurred when requesting api/foobar.", error));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment