Userscript template aktualisiert
This commit is contained in:
13
src/debounce.js
Normal file
13
src/debounce.js
Normal file
@ -0,0 +1,13 @@
|
||||
export function debounce (func, wait) {
|
||||
let timeout
|
||||
|
||||
return function executedFunction (...args) {
|
||||
const later = () => {
|
||||
clearTimeout(timeout)
|
||||
func(...args)
|
||||
}
|
||||
|
||||
clearTimeout(timeout)
|
||||
timeout = setTimeout(later, wait)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user