-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
Describe the bug
So I'm not 100% sure if this is a bug with runes, but it sure feels like one.
In the example below I have a $state rune in a Svelte component, and a $state rune in a JS file. Both are arrays, and I'm pushing values into the array and doing the old list = list trick to trigger an update. This works in the component, but not in the one imported from the JS file. The problem goes away if I uses a spread operator (list = [...list]), but I'd rather reuse the same array to reduce GC pressure (And I also have a considerable amount of code that mutates arrays rather than reallocating. It would be a pain to change it all).
Additionally, is my other export from the JS file 'idiomatic' for global state using runes? Is there a more rune-idiomatic way of writing what I have?
Reproduction
Edit: updated other.js -> other.svelte.js
Logs
No response
System Info
N/ASeverity
blocking an upgrade