Skip to main content
Module

x/rambda/throttle.js

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