MCPcopy
hub / github.com/vitejs/vite / debounce

Function debounce

packages/vite/src/node/server/bundledDev.ts:522–531  ·  view source on GitHub ↗
(time: number, cb: () => void)

Source from the content-addressed store, hash-verified

520}
521
522function debounce(time: number, cb: () => void) {
523 let timer: ReturnType<typeof globalThis.setTimeout> | null
524 return () => {
525 if (timer) {
526 globalThis.clearTimeout(timer)
527 timer = null
528 }
529 timer = globalThis.setTimeout(cb, time)
530 }
531}

Callers 1

BundledDevClass · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected