MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / scheduleEditorModuleWarmup

Function scheduleEditorModuleWarmup

packages/app-core/src/App.tsx:47–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45}
46
47function scheduleEditorModuleWarmup(): () => void {
48 let cancelled = false
49 let delayId: number | null = null
50 let frameId: number | null = null
51
52 const warmup = (): void => {
53 if (!cancelled) void loadEditorModule()
54 }
55
56 delayId = window.setTimeout(() => {
57 delayId = null
58 frameId = window.requestAnimationFrame(() => {
59 frameId = null
60 warmup()
61 })
62 }, EDITOR_MODULE_WARMUP_GRACE_MS)
63
64 return () => {
65 cancelled = true
66 if (delayId !== null) window.clearTimeout(delayId)
67 if (frameId !== null) window.cancelAnimationFrame(frameId)
68 }
69}
70
71function scheduleSearchPaletteModuleWarmup(): () => void {
72 let cancelled = false

Callers 1

AppFunction · 0.85

Calls 1

warmupFunction · 0.85

Tested by

no test coverage detected