Created
July 30, 2019 12:04
-
-
Save esneko/54570078c9f8972bf82fc81ca0985c81 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
export const debounce = (callback, timeout) => { | |
let id | |
return (...args) => { | |
clearTimeout(id) | |
return id = setTimeout(() => callback(...args), timeout) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment