fix resubscriptions inside script block (#2435)

pull/2619/head
Conduitry 5 years ago
parent 60e73c41dc
commit 0d890b1359

@ -201,7 +201,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