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

Store resubscriptions not being generated #2435

Closed
Conduitry opened this issue Apr 17, 2019 · 1 comment · Fixed by #2619
Closed

Store resubscriptions not being generated #2435

Conduitry opened this issue Apr 17, 2019 · 1 comment · Fixed by #2619
Labels

Comments

@Conduitry
Copy link
Member

Conduitry commented Apr 17, 2019

<script>
	import { writable } from 'svelte/store';
	let foo = writable(0);
	foo = writable(42);
</script>

{$foo}

This doesn't generate a resubscription upon the reassignment to foo. I believe this is a bug. I'm not sure what distinguishes the situation here from the one in #2014 (implemented in #2099), which has a passing unit test.


Adjacent issue: #2181. In addition to emitting appropriate resubscription code, perhaps in cases where foo is initialized to something we can tell is not a store, we could skip the (re)subscription call. I haven't thought this part all the way through.

@Conduitry Conduitry added the bug label Apr 17, 2019
@Conduitry
Copy link
Member Author

My guess is that #2099 only covered reassignments that happen in the template, not in the script tag.

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.

2 participants