Skip to content

Store resubscriptions not being generated #2435

@Conduitry

Description

@Conduitry
<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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions