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
Polyfill bug: calling watcher.watch on computed signal (before its latest value is computed) can prevent from getting its correct latest value afterward
#216
Open
divdavem opened this issue
Apr 30, 2024
· 0 comments
I have come across the following bug with the current polyfill implementation (0.1.0): if I call watcher.watch with a computed signal before reading its most up-to-date value, I can no longer get its correct up-to-date value:
constsignal=newSignal.State(0);constcomputedSignal=newSignal.Computed(()=>signal.get());constwatcher=newSignal.subtle.Watcher(()=>{});expect(computedSignal.get()).toBe(0);signal.set(1);// let's update the signal on which computedSignal dependswatcher.watch(computedSignal);// if this line is removed, the expectation on the following line is successfulexpect(computedSignal.get()).toBe(1);// this expectation fails with current polyfill implementation
The text was updated successfully, but these errors were encountered:
Hello,
I have come across the following bug with the current polyfill implementation (0.1.0): if I call
watcher.watch
with a computed signal before reading its most up-to-date value, I can no longer get its correct up-to-date value:The text was updated successfully, but these errors were encountered: