<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.
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
foois 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.