Created
January 12, 2024 15:42
-
-
Save dperuo/7880f97b041b9d0c04ceb98d515e9b32 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { fromEvent, pipe } = Rx; | |
const { scan, throttleTime } = RxOperators; | |
const tick = () => scan(next => next + 1, 0); | |
const throttled = () => throttleTime(500); | |
const paced = () => pipe(throttled(), tick()); | |
fromEvent(document, 'click').pipe(paced()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment