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

Function refresh

packages/effect/src/ui/internal/kernel.ts:1632–1669  ·  view source on GitHub ↗
(receiver: Instance, placed: Placed)

Source from the content-addressed store, hash-verified

1630 : (receiver.at.v as View.Child<any, any>).slots?.[name]
1631
1632const refresh = (receiver: Instance, placed: Placed): void => {
1633 const rec = placed.rec
1634 const view = rec.v as View.Outlet
1635 const content = slotOf(receiver, view.name)
1636 if (content === placed.content) return
1637 placed.content = content
1638 const declarer = receiver.parent!
1639 const host = receiver.tree.host
1640 const olds = rec.kids!
1641 const after = host.nextOf(lastNodeOf(olds[olds.length - 1]!))
1642 const outer = slot
1643 const fallbacks = shown
1644 slot = receiver.path + "/" + slotSegment(view.name)
1645 try {
1646 let views = noContent
1647 try {
1648 views = contentOf(view, content)
1649 } catch (error) {
1650 failLater(declarer, error)
1651 }
1652 const kids = rec.kids = patchList(
1653 declarer,
1654 host.parentOf(nodeOf(olds[0]!)),
1655 olds,
1656 views,
1657 after
1658 )
1659 if (dev && shown !== fallbacks) {
1660 try {
1661 checkShown(slot, kids, true)
1662 } catch (error) {
1663 failLater(declarer, error)
1664 }
1665 }
1666 } finally {
1667 slot = outer
1668 }
1669}
1670
1671const setAttrs = (
1672 host: Host,

Callers 2

patchFunction · 0.70
patchChildFunction · 0.70

Calls 10

slotSegmentFunction · 0.90
checkShownFunction · 0.90
lastNodeOfFunction · 0.85
failLaterFunction · 0.85
patchListFunction · 0.85
nodeOfFunction · 0.85
nextOfMethod · 0.80
parentOfMethod · 0.80
slotOfFunction · 0.70
contentOfFunction · 0.70

Tested by

no test coverage detected