I have:
getSth(): void {
this.service.functionName.pipe(
takeUntil(this.destroy$),
distinctUntilChanged(),
map(res => res.event)
).subscribe(((response) => {
this.getAnother(response);
})); }
getAnother(response): void {
this.anotherService.anotherFunctionName(response).subscribe((res) => {
this.result = res;
}); }
I know that isn't a good solution to write subscribe in subscribe. How to fix it?
Let's use switchMap :