Skip to content

Commit 151cdea

Browse files
authored
simplify test (#10538)
Co-authored-by: Rich Harris <[email protected]>
1 parent 9c8e643 commit 151cdea

File tree

1 file changed

+5
-9
lines changed
  • packages/svelte/tests/runtime-runes/samples/store-subscribe-effect-init

1 file changed

+5
-9
lines changed
Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
<script>
2-
import { untrack } from 'svelte';
32
import { writable } from 'svelte/store';
43
import { log } from './log';
54
6-
const storeCount = writable(0)
7-
let count = $state(0);
5+
const count = writable(0);
6+
let ran = 0;
87
98
$effect(() => {
10-
$storeCount;
11-
untrack(() => {
12-
count++;
13-
log.push(count);
14-
});
9+
$count;
10+
log.push(++ran);
1511
});
1612
</script>
1713

18-
<button on:click={() => $storeCount++}>increment</button>
14+
<button on:click={() => $count++}>increment</button>

0 commit comments

Comments
 (0)