Created
October 27, 2024 12:14
-
-
Save KostaMalsev/ef279ce9c4ca36d6a5a299b92b22efa0 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
//Debounce in js example: | |
function debounce(func, timeout = 300){ | |
let timer; | |
return (...args) => { | |
clearTimeout(timer); | |
timer = setTimeout(() => { func.apply(this, args); }, timeout); | |
}; | |
} | |
function saveInput(){ | |
console.log('Saving data'); | |
} | |
const processChange = debounce(() => saveInput()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment