* 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
()
| 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) { |
no outgoing calls
no test coverage detected