Skip to content

Instantly share code, notes, and snippets.

@benlesh
Created August 23, 2017 01:04
Show Gist options
  • Save benlesh/63ebcc5d773fccfa999e90919cca7342 to your computer and use it in GitHub Desktop.
Save benlesh/63ebcc5d773fccfa999e90919cca7342 to your computer and use it in GitHub Desktop.
function getErroringPromise() {
console.log('getErroringPromise called');
return Promise.reject(new Error('sad'));
}
Observable.defer(getErroringPromise)
.retry(3)
.subscribe(x => console.log);
// logs "getErroringPromise called" 4 times (once + 3 retries), then errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment