added a name to the forkjoin request item

It’s good to use the forkJoin api to combine the http requests, but there still has one insufficient, the forkJoin api need a array of requests or multiple requests as parameters and return a array of response, if we want to get the correct response we must order the index of the request item in the requests to accept it, it’s too trouble when we delete one of requests, the other responses’ index shoud be update or it will be wrong.

1 possible answer(s) on “added a name to the forkjoin request item

  1. You can use array destructuring instead of indices. For example:

    forkJoin(obsA, obsB, obsC).pipe(
      tap(([valA, valB, valC]) => { /* ... */ })
    );