MCPcopy Index your code
hub / github.com/simstudioai/sim / yieldToNextFrame

Method yieldToNextFrame

apps/sim/lib/pptx-renderer/core/viewer.ts:600–613  ·  view source on GitHub ↗

* Yield to the event loop between render batches so the browser can paint. * * We intentionally do NOT rely solely on `requestAnimationFrame`: rAF callbacks * are paused while the document is hidden (backgrounded tab). A render kicked * off in that state would otherwise stall forever on

()

Source from the content-addressed store, hash-verified

598 * matching the server-side renderer, which has no visibility dependency.
599 */
600 private yieldToNextFrame(): Promise<void> {
601 return new Promise<void>((resolve) => {
602 let settled = false
603 const finish = () => {
604 if (settled) return
605 settled = true
606 resolve()
607 }
608 if (typeof requestAnimationFrame === 'function') {
609 requestAnimationFrame(finish)
610 }
611 setTimeout(finish, 32)
612 })
613 }
614
615 private disposeAllCharts(): void {
616 for (const chart of this.chartInstances) {

Callers 2

renderAllSlidesFullMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected