title: RxJS - detect long mousedown
body: <p>I want to detect when <code>mousedown</code> is being fired for longer than 500ms, if so - do something. My attempt:</p>
  
  <pre><code>const button = document.querySelector('button')
  const stream = Rx.Observable.fromEvent(button, 'mousedown')
  const mouseUp$ = Rx.Observable.fromEvent(button, 'mouseup')
  stream.delay(500).takeUntil(mouseUp$).subscribe(() =&gt; console.log(1))
  </code></pre>
  
  <p>It works but only the first time it runs. Then, the stream is cancelled due to <code>takeUntil</code> operator. How to make it work everytime?</p>
  
  <p><a href="http://jsbin.com/maqeqinowo/edit?html,js,console,output" rel="nofollow noreferrer">DEMO</a></p>