Add js debounce util

pull/4713/head
Daniel Supernault 2 years ago
parent a144301085
commit 4e3e23db36
No known key found for this signature in database
GPG Key ID: 23740873EE6F76A1

@ -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)
}
}
Loading…
Cancel
Save