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/runtime/samples/reactive-statement-indirect/main.svelte

12 lines
274 B

<script>
let count = 1;
// Could be a let or simplified, but this tests that it still works like this
$: indirect_double = 2;
$: if (count > 0) {
indirect_double = count * 2;
}
</script>
<h1>{indirect_double}</h1>
<button on:click={() => count++}>Increment</button>