title: rxJs callback with observable being asynchronous
body: <p>I have a map operation in my rxjs flow</p>
  
  <pre><code>streaming.map((data) =&gt; {
    //example async call
    methodCall.then((response) =&gt; {
      return data.test
    })
  })
  .filter((value) =&gt; ...);
  </code></pre>
  
  <p>The thing is filter is called before data.test is returned naturally. So I tried converting it to switchMap and returning an observable</p>
  
  <pre><code>streaming.switchMap((data) =&gt; {
    return Observable.create((observer) =&gt; {
      //example async call
      methodCall.then((response) =&gt; {
        observer.next(data.test);
        observer.complete();
      });
    });
  })
  .filter((value) =&gt; ......);
  </code></pre>
  
  <p>I assumed that IN THIS case since we are returning an observable with explicit timing on next is called the filter would be called ONLY after the observer.complete is called but filter was called prematurely with the value variable undefined.</p>
  
  <p>How would I accomplish this normally using rxJs</p>