1
0
Fork 0

Add js debounce util

This commit is contained in:
Daniel Supernault 2023-10-23 00:15:53 -06:00 committed by chris
parent d6d45fa425
commit 19c57dd681
1 changed files with 11 additions and 0 deletions

11
resources/assets/js/util/debounce.js vendored Normal file
View File

@ -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)
}
}