title: How to do the chain sequence in rxjs
body: <p>I would like to to something like:</p>
  
  <pre><code>this._myService.doSomething().subscribe(result =&gt; {
    doSomething()
  });
  .then( () =&gt; dosthelse() )
  .then( () =&gt; dosanotherthing() )
  </code></pre>
  
  <p>So I would like to chain .then like in promise. How would I do that in Rxjs?</p>
  
  <pre><code>this._myService.getLoginScreen().subscribe( result =&gt; {
        window.location.href = MyService.LOGIN_URL;
        /// I would like to wait for the site to load and alert something from       the url, when I do it here it alerts the old one
      });
     .then (alert(anotherService.partOfTheUrl())
  
  
  getLoginScreen() {
    return this.http.get(myService.LOGIN_URL)
  .flatMap(result =&gt; this.changeBrowserUrl())
  .subscribe( result =&gt; //i want to do sth when the page is loaded//);
  }
  
  changeBrowserUrl(): Observable&lt;any&gt; {
  return Observable.create( observer =&gt; {
  window.location.href = myService.LOGIN_URL;
  observer.next();
  });
  }
  </code></pre>