-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
binding wrongly invalidates value that doesn't depend on it #4448
Comments
This seems to be related to the fix for #2444, and I'm not sure what the correct behavior is here. |
hmm.. you are binding with a reactive declared variable, |
relevant: <script>
import Component from './Component.svelte';
export let emails = ['[email protected]', '[email protected]'];
$: set = new Set(emails)
</script>
{#each emails as email}
<Component email={email} bind:set />
{/each} https://svelte.dev/repl/3a8736942c8149fea7e88b864fa7d9e1?version=3.23.0 updating |
Similar situation here with store and array: https://svelte.dev/repl/9bc03311dae044e8b9de7776735a8e09?version=3.24.1 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been closed as it was previously marked as stale and saw no subsequent activity. |
Consider the following :
svelte rightly compiles it down to :
now add a button that mutates
object.property
on clickand svelte will wrongly also invalidate
object
at inputwhich will in turn trigger the reactive statement
$: value = object.property
altough onlyvalue
changedthis compiles into the same code with immutables, it just doesn't run reactive statements because of equality checks
https://svelte.dev/repl/21f9a5430bf34348b471417a30fb0af9?version=3.18.2
related : #4426
The text was updated successfully, but these errors were encountered: