(_owner?: Solid.Owner)
| 217 | */ |
| 218 | export function debugOwnerComputations(owner?: Solid.Owner): void |
| 219 | export function debugOwnerComputations(_owner?: Solid.Owner): void { |
| 220 | const owner = _owner === undefined ? getOwner() : _owner |
| 221 | if (!owner) return console.warn('no owner passed to debugOwnedComputations') |
| 222 | |
| 223 | const marked = markDebugNode(owner, 'owned') |
| 224 | if (marked === true) return |
| 225 | onCleanup(marked) |
| 226 | |
| 227 | // for solid-refresh HMR memos, return the owned component |
| 228 | const {type, typeName, name} = getNodeState( |
| 229 | lookupOwner(owner, o => getOwnerType(o) !== NodeType.Refresh)!, |
| 230 | ) |
| 231 | |
| 232 | let prevOwned: Solid.Computation[] = [] |
| 233 | |
| 234 | onCleanup( |
| 235 | addSolidUpdateListener(() => { |
| 236 | const {owned} = owner |
| 237 | if (!owned) return |
| 238 | |
| 239 | let computations: Solid.Computation[] = [] |
| 240 | |
| 241 | let i = prevOwned.length |
| 242 | // owned can only be added |
| 243 | for (; i < owned.length; i++) { |
| 244 | const computation = owned[i]! |
| 245 | debugComputation(computation, { |
| 246 | initialRun: false, |
| 247 | }) |
| 248 | computations.push(computation) |
| 249 | } |
| 250 | if (computations.length === 0) return |
| 251 | |
| 252 | computations = [...prevOwned, ...computations] |
| 253 | // log owned computation changes |
| 254 | logOwned({type, typeName, name}, computations, prevOwned) |
| 255 | prevOwned = computations |
| 256 | }), |
| 257 | ) |
| 258 | } |
| 259 | |
| 260 | export interface DebugSignalOptions { |
| 261 | trackObservers?: boolean |
nothing calls this directly
no test coverage detected
searching dependent graphs…