mirror of https://github.com/sveltejs/svelte
parent
9c8e643b64
commit
151cdeacaf
@ -1,18 +1,14 @@
|
|||||||
<script>
|
<script>
|
||||||
import { untrack } from 'svelte';
|
|
||||||
import { writable } from 'svelte/store';
|
import { writable } from 'svelte/store';
|
||||||
import { log } from './log';
|
import { log } from './log';
|
||||||
|
|
||||||
const storeCount = writable(0)
|
const count = writable(0);
|
||||||
let count = $state(0);
|
let ran = 0;
|
||||||
|
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
$storeCount;
|
$count;
|
||||||
untrack(() => {
|
log.push(++ran);
|
||||||
count++;
|
|
||||||
log.push(count);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<button on:click={() => $storeCount++}>increment</button>
|
<button on:click={() => $count++}>increment</button>
|
||||||
|
Loading…
Reference in new issue