title: RxJs Observables nested subscriptions with takeUntil
body: <p>How am I supposed to get rid of these nested subscriptions? I thought to do that using concatMap or mergeMap - if you agree, how to I handle the takeUntil for inner subscriptions being different than the outer one? I am quite new to operators and RxJs.</p>
  <pre><code>this.myService.selectedCustomerId
  .pipe(
      takeUntil(this.unsubscribe),
  ).subscribe((customerId: number) =&gt; {
      // Do some stuff...
  
      this.anotherService.hasPermission(&quot;ROLE1&quot;, customerId).pipe(
          takeUntil(this.cancel),
      ).subscribe(hasPermission =&gt; this.hasPermissionForRole1 = hasPermission);
  
      this.anotherService.hasPermission(&quot;ROLE2&quot;, customerId).pipe(
          takeUntil(this.cancel),
      ).subscribe(hasPermission =&gt; this.hasPermissionForRole2 = hasPermission);
  
      this.anotherService.hasPermission(&quot;ROLE3&quot;, customerId).pipe(
          takeUntil(this.cancel),
      ).subscribe(hasPermission =&gt; this.hasPermissionForRole3 = hasPermission);
    }
  );
  </code></pre>