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

Function observeSources

packages/logger/src/index.ts:121–132  ·  view source on GitHub ↗
(sources: (Solid.Computation | Solid.Signal)[])

Source from the content-addressed store, hash-verified

119 // patches source objects to track their value updates
120 // will unsubscribe from previous sources on each call
121 const observeSources = (sources: (Solid.Computation | Solid.Signal)[]): void => {
122 updateListeners.forEach(unsub => unsub())
123 updateListeners = []
124 sources.forEach(source => {
125 observeValueUpdate(
126 source,
127 value => signalUpdates.push({...getNodeState(source), value}),
128 SYMBOL,
129 )
130 updateListeners.push(() => removeValueUpdateObserver(source, SYMBOL))
131 })
132 }
133
134 // this is for logging the initial state after the first callback execution
135 // the "value" property is monkey patched for one function execution

Callers 1

debugComputationFunction · 0.85

Calls 3

observeValueUpdateFunction · 0.90
getNodeStateFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…