Files
pos/node_modules/alpinejs/src/utils/debounce.js
2026-03-06 03:26:11 +07:00

19 lines
323 B
JavaScript

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