(node: Solid.Computation | Solid.Memo | Solid.Signal)
| 72 | } |
| 73 | |
| 74 | function 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 | |
| 95 | function visitObservers(node: Solid.Computation | Solid.Memo | Solid.Signal) { |
| 96 | if ('observers' in node && node.observers) { |
no test coverage detected
searching dependent graphs…