I want to run a set of observables one after another, since each result depends on the previous.
However, at the end I also need all the intermediate results, as they are given when we use forkJoin
- in an array.
I have the following code:
getData$ = getResponses$
.pipe(
switchMap((data_1) => {
return getResponse_1$;
})
)
.pipe(
switchMap((data_2) => {
return getResponse_2$;
})
);
getResponse_2$ depends on getResponse_1$ and getResponse_1$ depends on getResponses$
I want the final results i.e. getData$ to be an array of the intermediate results (like forkJoin
).
Is there such a way?