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

Function debugSignals

packages/logger/src/index.ts:369–393  ·  view source on GitHub ↗
(
    source: Many<Accessor<unknown>> | Solid.Signal[],
    options: DebugSignalOptions = {},
)

Source from the content-addressed store, hash-verified

367 * ```
368 */
369export function debugSignals(
370 source: Many<Accessor<unknown>> | Solid.Signal[],
371 options: DebugSignalOptions = {},
372): void {
373 let signals: Solid.Signal[] = []
374 asArray(source).forEach(s => {
375 if (typeof s === 'function') signals.push.apply(signals, getFunctionSources(s))
376 else signals.push(s)
377 })
378 if (signals.length === 0) return console.warn('No signals were passed to debugSignals')
379
380 // filter out already debugged signals
381 signals = signals.filter(s => !s.$debugSignal)
382
383 if (signals.length === 1) return debugSignal(signals[0]!, options)
384
385 if (options.logInitialValue === false) logSignalsInitialValues(signals)
386
387 signals.forEach(signal => {
388 debugSignal(signal, {
389 ...options,
390 logInitialValue: false,
391 })
392 })
393}
394
395/**
396 * Debug the {@link owner} signals by logging their lifecycle state to the browser console.

Callers 1

debugOwnerSignalsFunction · 0.85

Calls 4

asArrayFunction · 0.90
getFunctionSourcesFunction · 0.90
logSignalsInitialValuesFunction · 0.90
debugSignalFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…