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

Function debugOwnerSignals

packages/logger/src/index.ts:414–452  ·  view source on GitHub ↗
(owner = getOwner(), options: DebugSignalOptions = {})

Source from the content-addressed store, hash-verified

412 * ```
413 */
414export function debugOwnerSignals(owner = getOwner(), options: DebugSignalOptions = {}): void {
415 if (!owner) return console.warn('debugOwnerState found no Owner')
416
417 if (markDebugNode(owner, 'signals') === true) return
418
419 let prevSourceListLength = 0
420 let prevOwnedLength = 0
421
422 onCleanup(
423 addSolidUpdateListener(() => {
424 const signals: Solid.Signal[] = []
425
426 let i: number
427 // add owned signals
428 if (owner.sourceMap) {
429 const sourceList = Object.values(owner.sourceMap)
430 // signals can only be added
431 for (i = prevSourceListLength; i < sourceList.length; i++) {
432 const signal = sourceList[i]!
433 if (isSolidSignal(signal)) signals.push(signal)
434 }
435 prevSourceListLength = i
436 }
437 // add owned memos
438 if (owner.owned) {
439 // owned can only be added
440 for (i = prevOwnedLength; i < owner.owned.length; i++) {
441 const childOwner = owner.owned[i]!
442 if (isSolidMemo(childOwner)) signals.push(childOwner)
443 }
444 prevOwnedLength = i
445 }
446
447 if (signals.length === 0) return
448
449 debugSignals(signals, options)
450 }),
451 )
452}
453
454const getPropValue = (props: Record<string, unknown>, desc: PropertyDescriptor): unknown =>
455 untrack(() => (desc.get ? desc.get.call(props) : desc.value))

Callers

nothing calls this directly

Calls 6

addSolidUpdateListenerFunction · 0.90
isSolidSignalFunction · 0.90
isSolidMemoFunction · 0.90
markDebugNodeFunction · 0.85
onCleanupFunction · 0.85
debugSignalsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…