I would like to know what is the best practice when making http request one after another, especially, I'll be required to use the return value from the first request. Currently, I've a nested subscription to achieve this issue [See the code below].
I tried with siwtchMap, mergeMap & concat from RxJS, but it didn't seem to work. Any suggestion will be help for.
onStartUp() {
this.recordingService.getRecording(this.id)
.subscribe(x => {
this.recording = x;
const params = new Chunk(this.recording, 0, 30);
this.recordingService.getSignal(params)
.subscribe(data => console.log(data));
});
}
switchMapormergeMap?