title: RxJs: Executing 3 observables one after another and using results from first in second, and first and second in third requests
body: <p>I need to be able to execute 3 observables one after another so that I can use result value from 1st one in second and also 1st and 2nd result in the third one.</p>
  
  <p>Something like this (<em>it doesn't work as the serviceId is not visible in the third request</em>):</p>
  
  <pre><code>private setupStuff(): void {
          this.initRouteParams().pipe(
              switchMap(serviceId =&gt; this.getFileInfo(serviceId)),
              switchMap(fileName =&gt; this.getExistingFile(serviceId, fileName)
                  .subscribe(response =&gt; {
                      console.log(response);
                  }))
              );
      }
  </code></pre>