Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
debounce(() => {
// the requestAnimationFrame ensures it doesn't run when tab isn't active
stopWhenInactive ? raf(() => ric(fn, ricOptions)) : ric(fn, ricOptions)
}, timeout)