0
I have to get the answer from a Observable and use it from parameter to another Observable, I’m using the operator switchMap()
for that, but I don’t know if it’s the right way.
Ex.:
Observable1.pipe(
switchMap(resposta1 => observable2(resposta1)),
switchMap(resposta2 => observable3(resposta2))
).subscribe(resposta3 => this.minhaVariavel = resposta3);
vc can use these "flatMap" operators such as mergeMapp, switchMap, exhaustMap, depending on your use case
– Eduardo Vargas