You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/test/js/samples/unreferenced-state-not-inva.../input.svelte

21 lines
283 B

<script>
import { onMount } from 'svelte';
let a = 1, b = 2, c = 3;
onMount(() => {
const interval = setInterval(() => {
b += 1;
c += 1;
console.log(b, c);
}, 1000);
return () => clearInterval(interval);
});
$: x = a * 2;
$: y = b * 2;
</script>
<p>{y}</p>