From 67b49c53ab9d22bf08643367fb69099b5cbfff04 Mon Sep 17 00:00:00 2001 From: Brandon Lucas <38222767+thebrandonlucas@users.noreply.github.com> Date: Thu, 21 Mar 2024 12:14:32 +0000 Subject: [PATCH] update sveltekit example --- examples/sveltekit/.gitignore | 3 ++- .../sveltekit/src/components/QrCode/QrCode.svelte | 11 +++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/examples/sveltekit/.gitignore b/examples/sveltekit/.gitignore index 3050b7d..301a8a7 100644 --- a/examples/sveltekit/.gitignore +++ b/examples/sveltekit/.gitignore @@ -1,3 +1,4 @@ node_modules .svelte-kit -.env \ No newline at end of file +.env +.yarn/install-state.gz diff --git a/examples/sveltekit/src/components/QrCode/QrCode.svelte b/examples/sveltekit/src/components/QrCode/QrCode.svelte index 936d290..874a72d 100644 --- a/examples/sveltekit/src/components/QrCode/QrCode.svelte +++ b/examples/sveltekit/src/components/QrCode/QrCode.svelte @@ -14,23 +14,18 @@ export let pollCallback = () => {}; // FIXME: allow undefined without breaking TS export let clazz = ''; + defineCustomElements(); onMount(() => { - defineCustomElements(); const qr = document.getElementById('qr') as any; if (qr) { - qr.addEventListener('codeRendered', () => { - qr.callback = pollCallback; - qr.animateQRCode('MaterializeIn'); - }); + qr.callback = pollCallback; } }); onDestroy(() => { const qr = document.getElementById('qr') as any; if (qr) { - qr.removeEventListener('codeRendered', () => { - qr.callback = undefined; - }); + qr.callback = undefined; } });