Open knd775 opened 3 weeks ago
I believe this is a limitation of how stores work. They report updates about their whole value - not in a fine-grained way. This would be good to document, though.
Depending on what you're doing, $derived()
might be one way to deal with this. https://svelte.dev/playground/hello-world?version=5.1.4#H4sIAAAAAAAACo2R3WqEMBCFX2UIgsou2mtXhd71HWopiY4lNCYSx90Wybs3_nVLu7C9CeTMd84MMxPTvEOWsSdUysDFWNVAhI0kbGJ2ZK1UOLDseWL02c_cLHh9cz32fTKcUdGsCT7gLb02mlCTj2H5UFvZU1npimTXG0swwcVK4kIhOGit6SBcnelAxmJ4mlkfMRAsAhTfhmgCnsHDEYR_wcULqnADX7lHgwatPGMTBYuW8N-QuAGJFQqwbbGmKIqhKGGapYq26NP6m-cyChNl3qJw7Bvu1wZ7q3CNcXfTxD_SxM-0PL3uUediJDIajK6VrN-Lae2wT3E4uHIpAM_TFfXt96q75xdXv_jrF87fl_CDWEZ2RPfivgBr95YYUQIAAA==
Describe the bug
If a property of a store is used in an effect, the entire store becomes a dependency.
This is especially an issue when using something like superforms that stores formdata in a single store. Changing one field will cause all effects referencing any field to run.
Reproduction
https://svelte.dev/playground/ca42f41442a549d1a37ec9c4073cb061?version=5.1.4
Logs
No response
System Info
Severity
blocking an upgrade