MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / scheduleSync

Function scheduleSync

src/composables/useWindowsTitleBarOverlay.ts:29–47  ·  view source on GitHub ↗
(durationMs = 0)

Source from the content-addressed store, hash-verified

27 }
28
29 const scheduleSync = (durationMs = 0) => {
30 if (frameId) {
31 cancelAnimationFrame(frameId)
32 }
33
34 const startedAt = performance.now()
35 const tick = () => {
36 syncTitleBarColor()
37 if (performance.now() - startedAt < durationMs) {
38 frameId = requestAnimationFrame(tick)
39 } else {
40 frameId = 0
41 }
42 }
43
44 nextTick(() => {
45 frameId = requestAnimationFrame(tick)
46 })
47 }
48
49 const handleResize = () => scheduleSync()
50

Callers 2

handleResizeFunction · 0.85

Calls 2

nextTickFunction · 0.85
nowMethod · 0.45

Tested by

no test coverage detected