I have approach according to the below.
this.service1.info
.subscribe(a => this.service2.getDetails(a.id)
.subscribe(b => {
this.doStuff(b);
})
);
Recently, I noticed that we're going to have quite a few steps that gradually push more details to the client, so I'm anticipating the following atrocious pattern emerge.
this.service1.info
.subscribe(a => this.service2.getDetails(a.id)
...
.subscribe(z => {
this.doStuff (z);
})
);
Is there a nice trick in RxJS to handle such situations? I only need to perform an operation once all the steps in the consequential chain have been emitted/received. I've browsed through the docs but didn't find something that felt quite right. I suspect that it's there, just that my ignorance confuses me so I'm missing it.