MCPcopy Index your code
hub / github.com/marijnh/Eloquent-JavaScript / debounce

Function debounce

src/client/ejs.mjs:334–340  ·  view source on GitHub ↗
(fn, delay = 50)

Source from the content-addressed store, hash-verified

332}
333
334function debounce(fn, delay = 50) {
335 let timeout
336 return arg => {
337 if (timeout) clearTimeout(timeout)
338 timeout = setTimeout(() => fn(arg), delay)
339 }
340}
341
342if (window.page && /^chapter|hints$/.test(window.page.type)) {
343 chapterInteraction()

Callers 1

activateCodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected