Skip to content

Instantly share code, notes, and snippets.

@mattpodwysocki
Created April 25, 2015 20:03
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 mattpodwysocki/9f852d449c403c1d433f to your computer and use it in GitHub Desktop.
Save mattpodwysocki/9f852d449c403c1d433f to your computer and use it in GitHub Desktop.
var rawClicks = Rx.Observable.fromEvent(document.querySelector('#btn1'), 'click');
var result = rawClicks.buffer(rawClicks.debounce(500));
result.forEach(function(events) {
document.querySelector('#output').innerHTML = events.length + 'x clicks';
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment