I have 2 observables that should run concurrently, the code I have now seems to be running the 2 streams sequentially. StreamA$ completes then StreamB$ begins not as expected. How can I get the streams to run concurrently with mergeMap?
ngOnInit() {
this.streamA$ = this.streamService.getStream(1);
this.streamB$ = this.streamService.getOtherStream(2);
}
click() {
console.log('clicked');
this.streamA$
.pipe(
mergeMap(streamData => {
console.log(this.streamB$);
console.log(streamData);
return this.streamB$;
}) )
.subscribe(data => {
console.log(data);
});
}