Skip to content

Commit 83ca31b

Browse files
Refactor onMoint dynamic import
1 parent 1a9c023 commit 83ca31b

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

packages/svelte-query-devtools/src/Devtools.svelte

+16-14
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,23 @@
2020
let devtools: TanstackQueryDevtools | undefined
2121
2222
if (DEV && BROWSER) {
23-
onMount(async () => {
24-
const QueryDevtools = (await import('@tanstack/query-devtools'))
25-
.TanstackQueryDevtools
26-
devtools = new QueryDevtools({
27-
client,
28-
queryFlavor: 'Svelte Query',
29-
version: '5',
30-
onlineManager,
31-
buttonPosition,
32-
position,
33-
initialIsOpen,
34-
errorTypes,
35-
})
23+
onMount(() => {
24+
import('@tanstack/query-devtools').then((m) => {
25+
const QueryDevtools = m.TanstackQueryDevtools
26+
27+
devtools = new QueryDevtools({
28+
client,
29+
queryFlavor: 'Svelte Query',
30+
version: '5',
31+
onlineManager,
32+
buttonPosition,
33+
position,
34+
initialIsOpen,
35+
errorTypes,
36+
})
3637
37-
devtools.mount(ref)
38+
devtools.mount(ref)
39+
})
3840
3941
return () => {
4042
devtools?.unmount()

0 commit comments

Comments
 (0)