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
I'm experiencing a bug on my application that is very hard to reproduce to a minimal case on REPL. Anyway, after few hours of tweaking, I am able to make it happen on REPL and realize what's going on.
What does not work: Notice derived multi-store will not update and return initial value forever.
In summary:
// the source stores:storeA=writable({counter: 0,name: 'Thanh'})storeB=derived(storeA,$storeA=>$storeA.name)// somewhere down the path: increase counter, but name never changestoreA.update(current=>{...current,counter: current.counter+1});// the troubled store:storeC=derived([storeA,storeB],([$storeA,$storeB])=>{// should compute stuff when either storeA or storeB updates, but it never update});
I'm experiencing a bug on my application that is very hard to reproduce to a minimal case on REPL. Anyway, after few hours of tweaking, I am able to make it happen on REPL and realize what's going on.
This bug happen to Svelte 3.5.4
REPL: https://svelte.dev/repl/012883fabed9405fab808be3fd613d5c?version=3.5.4
What does not work: Notice derived multi-store will not update and return initial value forever.
In summary:
Interestingly, it was working previously with older version of Svelte, specifically, 3.2.1 from my yarn.lock: https://svelte.dev/repl/012883fabed9405fab808be3fd613d5c?version=3.2.1
After reproducing this, I realize that deriving from
storeA
is enough becausestoreB
also derive from it. (And that's my current work around).If
storeB
is a readable from another value, this bug won't happen.The text was updated successfully, but these errors were encountered: