MCPcopy Create free account
hub / github.com/Noumena-Network/code / installRenderTrace

Function installRenderTrace

src/utils/renderTrace.ts:19–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17}
18
19export function installRenderTrace(): {
20 reset: () => void
21 snapshot: () => Map<string, number>
22 uninstall: () => void
23} {
24 const store: RenderTraceStore = new Map()
25 ;(globalThis as Record<string, unknown>)[RENDER_TRACE_KEY] = store
26 return {
27 reset: () => store.clear(),
28 snapshot: () => new Map(store),
29 uninstall: () => {
30 delete (globalThis as Record<string, unknown>)[RENDER_TRACE_KEY]
31 },
32 }
33}
34
35export function diffRenderTrace(
36 before: ReadonlyMap<string, number>,

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected