title: Get observable, but wait for promise before activating
body: <p>I need to wait for a promise to complete before activating an observable in Angular 2 with RxJS.</p>
  
  <p>More specifically, I need to set up state using a third party library that returns promises, and insert some resulting information into my HTTP headers before making GET requests:</p>
  
  <pre><code>export class LiveDataService {
  
      private headersPromise;
  
      constructor(public http: Http) {
          this.headersPromise = $.connection('/init').then((state) =&gt; setupHeaders(state));
      }
  
      activate(route: string) {
          return this.http.get('api/v1/' + route, { headers })
              .Merge(anotherStateBasedObservable);
      }
  
  )
  </code></pre>
  
  <p>Except, although I need to return the observable immediately as shown, I also must wait for the promise to complete before calling the <code>http.get</code>.</p>
  
  <p>I can think of a couple ways that require like 3-4 stages of translation, but I feel like there should be a fairly direct way to do this.</p>