Skip to content
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 to store values from multiple components causes multiple updates for same value #3180

Closed
antony opened this issue Jul 5, 2019 · 4 comments · Fixed by #5126
Closed
Labels

Comments

@antony
Copy link
Member

antony commented Jul 5, 2019

I didn't know exactly how to describe this one, but it seems like if you bind to a store from more than one component, any manual subscriptions fire more than once for each update.

https://svelte.dev/repl/0a55c906240a46b3807f4135e7ff7c64?version=3.16.4

You will notice in the REPL, that you receive console log messages (or you can look at the "updated" count) to see the problem.

Binding automatically (using $) does not have the same problem.

@Conduitry Conduitry added the bug label Sep 12, 2019
@antony
Copy link
Member Author

antony commented Dec 14, 2019

Updated to latest Svelte. Still an issue it seems.

@ghost
Copy link

ghost commented Dec 14, 2019

@antony, Not saying thumbs up because it still happens (lol), I'm trying to mark issues that need attention and see if I can detect it using the API.

@Conduitry
Copy link
Member

@ToP29
Copy link

ToP29 commented Nov 26, 2020

I am at "svelte": "^3.29.7" and this problem still occurs. When i roll back to 3.24.1 the problem is still there too.

In my case I am bound to store 3 times like this:
<CheckboxList bind:array={$filters.foo} />
<CheckboxList bind:array={$filters.bar} />
<CheckboxList bind:array={$filters.baz} />

And manualy subscribed update happens exactly 3 times more, than it should. If I remove this bind, everything works as it should.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants