Skip to main content
Module

x/rambda/source/throttle.js

Faster and smaller alternative to Ramda
Latest
File
export function throttle(fn, ms){ let wait = false let result
return function (...input){ if (!wait){ result = fn.apply(null, input) wait = true setTimeout(() => { wait = false }, ms) }
return result }}