I would like to make two sequentially calls (if the first one is completed, call the second one):
My Code is like:
myApiClient
.firstApiCall()
.pipe(take(1),
concatMap (firstResult => {
doSomethingWithResponse(firstResult);
return myApiClient.secondApiCall();
}), take(1))
.subscribe(secondResult => {
doSomethingWithResponse(firstResult);
}, error => {
catchSecondApiCallError(error);
});
First question: is that the right way to make sequential calls? Second question: How could I catch the error for the first Call?