Update Fix
This commit is contained in:
18
node_modules/alpinejs/src/utils/debounce.js
generated
vendored
Normal file
18
node_modules/alpinejs/src/utils/debounce.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
export function debounce(func, wait) {
|
||||
let timeout
|
||||
|
||||
return function() {
|
||||
const context = this, args = arguments
|
||||
|
||||
const later = function () {
|
||||
timeout = null
|
||||
|
||||
func.apply(context, args)
|
||||
}
|
||||
|
||||
clearTimeout(timeout)
|
||||
|
||||
timeout = setTimeout(later, wait)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user