MCPcopy Create free account
hub / github.com/anomalyco/opencode / waitForPaint

Function waitForPaint

packages/app/src/context/global-sync/bootstrap.ts:36–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34}
35
36function waitForPaint() {
37 return new Promise<void>((resolve) => {
38 let done = false
39 const finish = () => {
40 if (done) return
41 done = true
42 resolve()
43 }
44 const timer = setTimeout(finish, 50)
45 if (typeof requestAnimationFrame !== "function") return
46 requestAnimationFrame(() => {
47 setTimeout(() => {
48 clearTimeout(timer)
49 finish()
50 }, 0)
51 })
52 })
53}
54
55function errors(list: PromiseSettledResult<unknown>[]) {
56 return list.filter((item): item is PromiseRejectedResult => item.status === "rejected").map((item) => item.reason)

Callers 1

bootstrapDirectoryFunction · 0.85

Calls 1

finishFunction · 0.70

Tested by

no test coverage detected