Created
March 26, 2020 16:49
-
-
Save moonformeli/31ba5dc0976994b571901f5a103f60d2 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 debounce = (delay, fn) => { | |
let inDebounce = null; | |
return args => { | |
clearTimeout(inDebounce); | |
inDebounce = setTimeout(() => fn(args), delay); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment