Skip to content

Commit

Permalink
chore: use $effect instead legacy run
Browse files Browse the repository at this point in the history
  • Loading branch information
userquin committed Nov 2, 2024
1 parent b018c44 commit 87f6c7f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script lang="ts">
import { run } from 'svelte/legacy';
import { spring } from 'svelte/motion';
let count = $state(0);
Expand All @@ -11,7 +9,7 @@
// handle negative numbers
return ((n % m) + m) % m;
}
run(() => {
$effect(() => {
displayed_count.set(count);
});
let offset = $derived(modulo($displayed_count, 1));
Expand Down
4 changes: 1 addition & 3 deletions examples/sveltekit-ts/src/lib/Counter.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script lang="ts">
import { run } from 'svelte/legacy';
import { spring } from 'svelte/motion';
let count = $state(0);
Expand All @@ -11,7 +9,7 @@
// handle negative numbers
return ((n % m) + m) % m;
}
run(() => {
$effect(() => {
displayed_count.set(count);
});
let offset = $derived(modulo($displayed_count, 1));
Expand Down

0 comments on commit 87f6c7f

Please sign in to comment.