MCPcopy Create free account
hub / github.com/Effect-TS/effect / paint

Function paint

packages/effect/src/ui/internal/kernel.ts:1122–1154  ·  view source on GitHub ↗
(inst: Instance, parent?: unknown)

Source from the content-addressed store, hash-verified

1120 * @internal
1121 */
1122export const paint = (inst: Instance, parent?: unknown): Rec | undefined => {
1123 const outer = slot
1124 const from = born.length
1125 const fallbacks = shown
1126 const by = authorOf(inst)
1127 slot = by === inst ? undefined : inst.path
1128 busy++
1129 try {
1130 // A dirty bound child placed before its own render follows its shared reads first.
1131 const dirty = inst.dirty
1132 inst.dirty = false
1133 if (dirty && !follow(inst)) return undefined
1134 const tree = viewOf(inst)
1135 if (tree === undefined) return undefined
1136 let rendered: Rec
1137 try {
1138 rendered = create(by, tree, parent)
1139 if (dev && shown !== fallbacks) checkShown(inst.path, [rendered])
1140 } catch (error) {
1141 fail(inst, "view", Cause.die(error), undefined, from)
1142 return undefined
1143 }
1144 if (inst.closed) {
1145 release(inst, rendered)
1146 return undefined
1147 }
1148 return inst.rendered = rendered
1149 } finally {
1150 busy--
1151 born.length = from
1152 slot = outer
1153 }
1154}
1155
1156const start = (inst: Instance, parent?: unknown): Rec | undefined => {
1157 busy++

Callers 1

startFunction · 0.70

Calls 7

checkShownFunction · 0.90
authorOfFunction · 0.70
followFunction · 0.70
viewOfFunction · 0.70
createFunction · 0.70
failFunction · 0.70
releaseFunction · 0.70

Tested by

no test coverage detected