-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
#snippet
param partially loses reactivity
#14982
Comments
#snippet
param loses reactivity (partially)
#snippet
param loses reactivity (partially)#snippet
param partially loses reactivity
There is some compiler magic that associates the set progress($$value) {
(
$.get(task).progress = $$value,
$.invalidate_store($$stores, "$tasks") // <- invalidation causing updates
);
} With the snippet, there currently is no such association; only the |
ah i see, thanks for the explanation @brunnerh. i'll just use runes then |
just for posterity, yeah as per @brunnerh the store itself needs to be referenced for binding {#snippet TaskCard(task, i)}
<div>
<span>{task.id}</span>
<span> - </span>
<span>{task.title}</span>
<span> - </span>
<span>{task.progress.times} / {task.progress.completed}</span>
<span> - </span>
<CompleteButton bind:progress={$tasks.today[i].progress} />
</div>
{/snippet} key line: |
Describe the bug
If i pass a state (from a store) as a param to a snippet and then go on to pass a value of that param to a component with
$bindable
prop it loses it's reactivity partially, it still reacts to state updates from outside but not if the state is updated from within the snippetIs there a way to still keep it reactive? this doesn't happen when i do it inline without using snippet
Here's a screen recording of how the same piece of logic behaves but one uses snippet and the other is inline
402278497-f159926f-5cfe-4fda-b91d-6c6109d4bc19.mov
Reproduction
Here's a reproduction link
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: