Skip to content

Instantly share code, notes, and snippets.

@djleonskennedy
Created January 27, 2017 13:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djleonskennedy/a06de5d506affa758a299d85563bdf2a to your computer and use it in GitHub Desktop.
Save djleonskennedy/a06de5d506affa758a299d85563bdf2a to your computer and use it in GitHub Desktop.
let clicks$ = Rx.Observable.fromEvent(document.getElementById('button'), 'click');
clicks$
.buffer(clicks$.debounce(250))
.map(list => list.length)
.filter(x => x === 2)
.subscribe(() => {
console.log('doubleclick');
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment