Created
August 23, 2017 01:04
-
-
Save benlesh/63ebcc5d773fccfa999e90919cca7342 to your computer and use it in GitHub Desktop.
Examples for https://medium.com/p/651f4b7d45cf/edit
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
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