I make several sequential requests and the result of anotherRequest
is used in the second mergeMap
-clause. This basically works fine.
My question is: How can I repeat anotherRequest
until some condition is met and only pass the approved return-value to the second mergeMap
-clause?
someRequest().pipe(
mergeMap((info) => {
this.appService.petitionId$.next(Number(lastInfo.petitionId));
return anotherRequest();
}),
mergeMap(
...
),
);