We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c8e643 commit 151cdeaCopy full SHA for 151cdea
packages/svelte/tests/runtime-runes/samples/store-subscribe-effect-init/main.svelte
@@ -1,18 +1,14 @@
1
<script>
2
- import { untrack } from 'svelte';
3
import { writable } from 'svelte/store';
4
import { log } from './log';
5
6
- const storeCount = writable(0)
7
- let count = $state(0);
+ const count = writable(0);
+ let ran = 0;
8
9
$effect(() => {
10
- $storeCount;
11
- untrack(() => {
12
- count++;
13
- log.push(count);
14
- });
+ $count;
+ log.push(++ran);
15
});
16
</script>
17
18
-<button on:click={() => $storeCount++}>increment</button>
+<button on:click={() => $count++}>increment</button>
0 commit comments