Skip to content

Commit

Permalink
Add test for issue #15.
Browse files Browse the repository at this point in the history
  • Loading branch information
kitschpatrol committed Sep 15, 2024
1 parent ed5befe commit d2ce430
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/examples/tests/TestStoreInitialization.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<script lang="ts">
// Via https://github.com/kitschpatrol/svelte-tweakpane-ui/issues/15
import { Slider } from '$lib';
import { onMount, tick } from 'svelte';
import { writable } from 'svelte/store';
const bear = writable({ apples: 100, name: 'Cleeve' });
onMount(async () => {
await tick();
$bear.apples = 60;
});
</script>

<p>Native input</p>
<input bind:value={$bear.apples} min={0} max={100} step={1} type="range" />
{$bear.apples}
<p>Svelte Tweakpane UI</p>
<Slider bind:value={$bear.apples} min={0} max={100} step={1} />

0 comments on commit d2ce430

Please sign in to comment.