MCPcopy Index your code
hub / github.com/epicweb-dev/react-performance / debounce

Function debounce

epicshop/fix-watch.js:35–43  ·  view source on GitHub ↗

* Simple debounce implementation

(fn, delay)

Source from the content-addressed store, hash-verified

33 * Simple debounce implementation
34 */
35function debounce(fn, delay) {
36 let timer = null
37 return (...args) => {
38 if (timer) clearTimeout(timer)
39 timer = setTimeout(() => {
40 fn(...args)
41 }, delay)
42 }
43}
44
45let running = false
46

Callers 1

fix-watch.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected