S
S
slowkazak2016-08-10 12:52:04
typescript
slowkazak, 2016-08-10 12:52:04

What is the best way to make a request in angular2 http + rxJS with addresses from an array?

Good time, connoisseurs!
Let's say we have an array:

arr = [angular2_http_get1,angular2_http_get2,angular2_http_getN];

It would be nice to use Observable.forkJoin(this.arr) in the serviceprovider and give the results of forkJoin to the subscriber in the component.
But, as far as I understand, forkJoin will fail if an error occurs in one of the requests.
Moreover, I actually need forkJoin once, then I can just work with one single GET request.
That is, I first want to execute all requests and give the result to the subscriber, and then execute one request at a time and also give data to the subscriber.
So, are there any good practices on this?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question