title: How to wait ajax done then retrigger ajax in rxjs
body: <p>I'm new to rxjs and I wanna do a simple feature, make a button every click event will send a ajax, when prev ajax does not respond the button just return</p>
  
  <p>In pure js, I just set a flag to check ajax done or not, but I know how to do this feature in rxjs.</p>
  
  <p>pure js code like</p>
  
  <pre><code>let flag = false;
  let el = document.querySelector("#btn");
  el.addEventListener("click",handleBtn);
  let handleBtn = () =&gt; {
     if(flag) return;  // if ajax no response then return
     fakeAjaxCall().then(
       val =&gt; flag = true, 
       reason =&gt; console.log(reason)
     )
  }
  </code></pre>
  
  <p>maybe in rxjs like this, </p>
  
  <pre><code>import { Observable, Subject, ReplaySubject, from, of, range } from "rxjs/Rx";
      const btn$ = Observable.fromEvent(
        this.refs["btn"],
        "click"
      ).subscribe(fakeAjaxCall()); 
  </code></pre>