Merge pull request #2619 from sveltejs/gh-2435

fix resubscriptions inside script block
pull/2670/head
Rich Harris 5 years ago committed by GitHub
commit 6240ed0b94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -203,7 +203,7 @@ export default function dom(
const variable = component.var_lookup.get(name);
if (variable && (variable.hoistable || variable.global || variable.module)) return;
if (single) {
if (single && !(variable.subscribable && variable.reassigned)) {
code.prependRight(node.start, `$$invalidate('${name}', `);
code.appendLeft(node.end, `)`);
} else {

@ -0,0 +1,3 @@
export default {
html: `42`,
};

@ -0,0 +1,7 @@
<script>
import { writable } from 'svelte/store';
let foo = writable(0);
foo = writable(42);
</script>
{$foo}
Loading…
Cancel
Save