title: Debounce Rx.Observable & ignore values emitted in between
body: <p><a href="https://jsfiddle.net/90z9cy7j/2/" rel="nofollow noreferrer">jsfiddle</a></p>
  
  <pre><code>  let sub = new Rx.Subject();
    let val = 0;
    Rx.Observable.fromEvent(window, 'scroll')
    .do(_ =&gt; val++)
    .debounceTime(500)
    .subscribe(c =&gt; sub.next(val)); 
  
    sub.subscribe(v =&gt; console.log(v));
  </code></pre>
  
  <p>I have an observable on scroll event. I would like to ignore the values from it unless some time has passed.</p>
  
  <p>it would look like this (e being events, and the <code>debounceTime</code> being <code>500</code>):</p>
  
  <pre><code> ---e1----e2----e3----e4----e6-----e7 &lt;- events
  
   ---n1----------------------n6------- &lt;- notifications
  
   0--100------------------600------ &lt;- time
  </code></pre>
  
  <p>And like this:</p>
  
  <pre><code> ---e1----e2----e3----e4----------------- &lt;- events
  
   ---n1------------------------------------- &lt;- notifications
  
   0--100--------------------500------------- &lt;- time
  </code></pre>