MCPcopy Create free account
hub / github.com/thetarnav/solid-devtools / visitSources

Function visitSources

packages/debugger/src/dependency/collect.ts:74–93  ·  view source on GitHub ↗
(node: Solid.Computation | Solid.Memo | Solid.Signal)

Source from the content-addressed store, hash-verified

72}
73
74function visitSources(node: Solid.Computation | Solid.Memo | Solid.Signal) {
75 let n = 0
76 if ('sources' in node && node.sources) {
77 for (const source of node.sources) {
78 const isOwner = isSolidOwner(source)
79 // skip refresh nodes (they aren't part of the actual graph)
80 if (isOwner && getOwnerType(source) === NodeType.Refresh) continue
81 n++
82 if (VisitedSources.has(source)) continue
83 VisitedSources.add(source)
84 // skip frozen memos (if memo is not subscribed to anything it won't ever update)
85 if (isOwner && visitSources(source) === 0) {
86 n--
87 continue
88 }
89 addNodeToGraph(source)
90 }
91 }
92 return n
93}
94
95function visitObservers(node: Solid.Computation | Solid.Memo | Solid.Signal) {
96 if ('observers' in node && node.observers) {

Callers 1

collectDependencyGraphFunction · 0.85

Calls 3

isSolidOwnerFunction · 0.90
getOwnerTypeFunction · 0.90
addNodeToGraphFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…