You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a watcher for a computed depending on two sources is notified, if one source updates and a watcher is added during notification to the other source, an internal error is thrown
#192
Open
dead-claudia opened this issue
Apr 24, 2024
· 3 comments
constWA=newSignal.subtle.Watcher(()=>{console.log("watch WA")WA.watch(C)})constA=newSignal.Computed(()=>{console.log("get A")B.get()C.get()console.log("get A end")})constB=newSignal.State(1)constC=newSignal.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.
Repro for 0.1.0: link
Source:
The text was updated successfully, but these errors were encountered: