Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

RxJS study - retry promise

node v10.24.1
version: master
endpointsharetweet
const { from, of } = require("rxjs") const { switchMap, retry }= require("rxjs/operators") function getSearchResults(url) { return new Promise((resolve, reject) => { console.log('do again') reject("Reject") }) } of("http://foo.com").pipe( switchMap(url => from(getSearchResults(url))), retry(3) ) .subscribe({ next: val => console.log(val), error: val => console.log(`Get error ${val}`) })
Loading…

no comments

    sign in to comment