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

Function debounceReload

packages/vite/src/client/client.ts:134–145  ·  view source on GitHub ↗
(time: number)

Source from the content-addressed store, hash-verified

132const outdatedLinkTags = new WeakSet<HTMLLinkElement>()
133
134const debounceReload = (time: number) => {
135 let timer: ReturnType<typeof setTimeout> | null
136 return () => {
137 if (timer) {
138 clearTimeout(timer)
139 timer = null
140 }
141 timer = setTimeout(() => {
142 location.reload()
143 }, time)
144 }
145}
146const pageReload = debounceReload(20)
147
148const hmrClient = new HMRClient(

Callers 1

client.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected