Skip to content

Instantly share code, notes, and snippets.

@rockydd
Created May 23, 2019 00:33
Show Gist options
  • Save rockydd/8a6d82709d56380c4b08ff759d8431c0 to your computer and use it in GitHub Desktop.
Save rockydd/8a6d82709d56380c4b08ff759d8431c0 to your computer and use it in GitHub Desktop.
import { fromEvent, interval } from 'rxjs';
import { throttle } from 'rxjs/operators';
const clicks = fromEvent(document, 'click');
//const result = clicks.pipe(throttle(ev => interval(1000)));
const result = interval(2000).pipe(throttle( i => clicks));
result.subscribe(x => console.log(x));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment