Created
June 10, 2018 22:43
-
-
Save lonekorean/3ce475111f2f08f134b6c1944380f3d8 to your computer and use it in GitHub Desktop.
Function to throttle scroll handling
This file contains hidden or 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
onScrollThrottled() { | |
if (!this.scrollTimeout) { | |
this.scrollTimeout = setTimeout(this.onScroll.bind(this), this.scrollDelay); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment