debounce.js 238 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 export function debounce (fn, delay) { let timer = null return function () { const self = this const args = arguments clearTimeout(timer) timer = setTimeout(function () { fn.apply(self, args) }, delay) } }