MCPcopy
hub / github.com/vuejs/core / registerHMR

Function registerHMR

packages/runtime-core/src/hmr.ts:60–68  ·  view source on GitHub ↗
(instance: ComponentInternalInstance)

Source from the content-addressed store, hash-verified

58> = new Map()
59
60export function registerHMR(instance: ComponentInternalInstance): void {
61 const id = instance.type.__hmrId!
62 let record = map.get(id)
63 if (!record) {
64 createRecord(id, instance.type as HMRComponent)
65 record = map.get(id)!
66 }
67 record.instances.add(instance)
68}
69
70export function unregisterHMR(instance: ComponentInternalInstance): void {
71 map.get(instance.type.__hmrId!)!.instances.delete(instance)

Callers 1

mountComponentFunction · 0.90

Calls 2

createRecordFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected