title: Observables inside of tap() complete
body: <p>If I use the tap rxjs operator on an observable to call another observable, can I guarantee that it completes before the rest of the pipe?</p>
  
  <p>The idea here is to have a service make an http call to the backend, if it's a good login, create a cookie, then return a mapped  response to the consuming component.  I want to make sure the cookie is added before continuing to make sure there are no race conditions.</p>
  
  <pre><code>import { of, Observable } from 'rxjs';
  import { map, tap } from 'rxjs/operators';
  
  
  const httpObservable = loginAccount('fsdfds', 'fdsfsd');
  
  httpObservable.subscribe(x =&gt; {
      console.log(x);
  });
  
  
  
  function loginAccount(username, password): Observable&lt;any&gt; {
      const httpResponse = of({ loggedIn: false, data: 'faketokenfrombackend' });
  
      return httpResponse.pipe(
          // Will this AWLAYS complete before map?
          tap(resp =&gt; fakeLocalStorage('Do something with the result')),
          // Will this AWLAYS complete before map?
          tap(resp =&gt; fakeLocalStorage('Do something else with the result')),
          map(resp =&gt; {
              if (!resp.loggedIn)
                  return { success: false, message: 'really bad thing happened' };
              else
                  return {success: true, message: 'WEEEEEE, it worked!'}
          }));
  }
  
  function fakeLocalStorage(data: string): Observable&lt;boolean&gt; {
      console.log('adding token to cookie');
      return of(true);
  }
  </code></pre>
  
  <p>The above script outputs this to the console window as expected, but can I rely on it?</p>
  
  <pre><code>adding token to cookie
  adding token to cookie
  {success: false, message: "really bad thing happened"}
  </code></pre>