K
K
Konstantin Kudelko2017-08-16 18:27:25
JavaScript
Konstantin Kudelko, 2017-08-16 18:27:25

How to solve such RxJs problem?

Observable.interval(10000)
.switchMap(() => this.http.get(url))
.catch (err => Observable.empty())
.subscribe(data => render(data))

It turns out that every 10 seconds there is a request to the server, and if an error occurs, reject occurs and the request does not go further, how to do it in order to bypass the error, that is, even if there is an error, still execute the request

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0X12eb, 2017-08-17
@0X12eb

.finally( () => this.handleComplete )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question