After extensively searching the internet, I have yet to discover a suitable solution for my specific scenario. My current setup involves using the MEAN stack (Angular 6) and implementing a registration form. What I am seeking is a method to make successive HTTP calls to the API where each call relies on the response from the previous one. The structure I envision is as follows:
firstPOSTCallToAPI('url', data).pipe(
result1 => secondPOSTCallToAPI('url', result1)
result2 => thirdPOSTCallToAPI('url', result2)
result3 => fourthPOSTCallToAPI('url', result3)
....
).subscribe(
success => { /* display success msg */ },
errorData => { /* display error msg */ }
);
I am inquiring about which RxJS operators I should utilize to accomplish this task. While nesting multiple subscriptions is one approach, I am eager to explore more efficient options with RxJS. Additionally, considerations for error handling are crucial.