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

Function lookupDepth

packages/debugger/src/dependency/collect.ts:108–122  ·  view source on GitHub ↗
(node: Solid.Owner | Solid.Signal)

Source from the content-addressed store, hash-verified

106}
107
108function lookupDepth(node: Solid.Owner | Solid.Signal): number {
109 const id = getSdtId(node, isSolidOwner(node) ? ObjectType.Owner : ObjectType.Signal)
110
111 if (id in DepthMap) return DepthMap[id]!
112
113 let owner: Solid.Owner | undefined | null
114 // signal
115 if (!('owned' in node)) owner = node.graph
116 // root
117 else if (!('fn' in node) && !node.owner) return 0
118 // computation
119 else owner = node.owner
120
121 return (DepthMap[id] = owner ? lookupDepth(owner) + 1 : 0)
122}
123
124export function collectDependencyGraph(
125 node: Solid.Computation | Solid.Memo | Solid.Signal,

Callers 1

addNodeToGraphFunction · 0.85

Calls 2

getSdtIdFunction · 0.90
isSolidOwnerFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…