pixelfed/resources/assets/js/util/debounce.js
2023-10-23 00:15:53 -06:00

12 lines
246 B
JavaScript
Vendored

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