-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Open
Description
Describe the bug
When using a fromStore() with a store that hold an object, the update of the object's fields is not reported in the store, which breaks reactivity.
Ex: something like this :
// counter is a store containing an object like { value : 0 }
let count = fromStore(counter);
function increment() {
count.current.value++;
}- In runes mode, the increment is done on the object, but there is no reactivity.
- In non-runes mode, the increment is done on the object, but the reactivity is limited to the current component.
Reproduction
Demo here :
- The first two buttons use a store with Svelte 4
$syntax, and incrementing the value is reactive in all components. π - The middle two buttons use
fromStore()in runes mode, and incrementing the value is not reactive at all ! - The last two buttons use
fromStore()in non-runes mode, and incrementing the value is only reactive on the current component.
Logs
No response
System Info
REPLSeverity
annoyance
knejadshamsi and Bladesheng
Metadata
Metadata
Assignees
Labels
No labels