Open dead-claudia opened 3 weeks ago
Same issue when reusing WA: link
Source:
const WA = new Signal.subtle.Watcher(() => {
console.log("watch WA")
WA.watch(C)
})
const A = new Signal.Computed(() => {
console.log("get A")
B.get()
C.get()
console.log("get A end")
})
const B = new Signal.State(1)
const C = new Signal.State(1)
A.get()
WA.watch(A)
B.set(2)
I suspect this Error is intentional in order to avoid any mutation of the graph (other than dirtying) during the dirtying phase. Calling .watch(signal)
will potentially and add new consumer<->producer links to the graph, which might or might not trigger the Watchers notify callback again in the same dirtying phase.
C
isn't dirty, only A
and B
are. And when pre-added, WC isn't notified, only WA.
Repro for 0.1.0: link
Source: