Skip to content

Commit b077518

Browse files
committed
chore: update example
1 parent 0271a15 commit b077518

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

examples/with-svelte/src/App.svelte

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import { onMount } from 'svelte'
55
66
let fw: Fireworks
7-
let enabled = true
7+
let mounted = true
88
let options: FireworksOptions = {
99
opacity: 0.5
1010
}
@@ -26,15 +26,16 @@
2626

2727
<main>
2828
<div class="buttons">
29-
<button on:click={() => (enabled = !enabled)}>
30-
{enabled ? 'Enabled' : 'Disabled'}
31-
</button>
32-
<button on:click={() => toggleFireworks()}>
33-
Toggle
29+
<button on:click={() => (mounted = !mounted)}>
30+
{mounted ? 'Mounted' : 'Unmounted'}
3431
</button>
3532
</div>
36-
{#if enabled}
37-
<Fireworks bind:this={fw} autostart={false} {options} class="fireworks" />
33+
{#if mounted}
34+
<Fireworks
35+
bind:this={fw}
36+
{options}
37+
class="fireworks"
38+
/>
3839
{/if}
3940
</main>
4041

0 commit comments

Comments
 (0)