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

Method addToMap

packages/vite/src/shared/hmr.ts:121–125  ·  view source on GitHub ↗
(map: Map<string, any[]>)

Source from the content-addressed store, hash-verified

119 cb: (payload: InferCustomEventPayload<T>) => void,
120 ): void {
121 const addToMap = (map: Map<string, any[]>) => {
122 const existing = map.get(event) || []
123 existing.push(cb)
124 map.set(event, existing)
125 }
126 addToMap(this.hmrClient.customListenersMap)
127 addToMap(this.newListeners)
128 }

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected