UNPKG

quasar

Version:

Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time

17 lines (14 loc) 309 B
export default function throttle(fn, limit = 250) { let wait = false, result return function runThrottle(/* ...args */) { if (wait === false) { wait = true setTimeout(() => { wait = false }, limit) result = fn.apply(this, arguments) } return result } }