Add js debounce util

pull/4713/head
Daniel Supernault 2023-10-23 00:15:53 -06:00
rodzic a144301085
commit 4e3e23db36
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 23740873EE6F76A1
1 zmienionych plików z 11 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,11 @@
export function debounce (fn, delay) {
var timeoutID = null
return function () {
clearTimeout(timeoutID)
var args = arguments
var that = this
timeoutID = setTimeout(function () {
fn.apply(that, args)
}, delay)
}
}