title: 2 Observers and must return one of them according to value
body: <p>I'm a beginner in Angular, I'm working with Angular 4 and Ionic 3.
  I got a method that should return an Observable.</p>
  
  <p>In this method I have to pick the good Observable between 2 according to the value of the first.</p>
  
  <p>I tried multiple ways to perform it but I take issue with the asynchronism.</p>
  
  <p>The following code not working because of the asynchronism but I do not found another way.</p>
  
  <pre><code>let obs: Observable&lt;T&gt;;
  let localFile: FileBase64Model;
  /* This will get my first observer I got to check his value */
  obs = this.localDataBaseSrv.getQualityCheckpointFile(fileId) as Observable&lt;T&gt;;
      return obs.pipe(
        map(file =&gt; {
          // If observer value is not true I got to return another observer
          if(!file) {              
            // I cannot return observable here, so I'm trying to get value of other observable and put it in my observable that will be return
            this.get(`/${fileId}`, undefined, body).subscribe(value =&gt;     localFile = value as FileBase64Model);
          } else {
            return file;
          }
        }),
        map( file =&gt;  {
          // When code is here, the localFile is not yet complete because of asynchronous subscribe method !
          if(!file) {              
            return localFile;
          } else {
            return file;
          }
        })
      );
  </code></pre>
  
  <p>Can someone help me ?</p>