Skip to content

Commit 4d048ed

Browse files
committed
chore: testes
1 parent 333c24e commit 4d048ed

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

playground/src/main.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import { createApp } from 'vue'
22
import App from './App.vue'
3-
import { MutationCache, QueryCache, VueQueryPlugin } from '@tanstack/vue-query'
3+
import {
4+
MutationCache,
5+
QueryCache,
6+
VueQueryPlugin,
7+
type VueQueryPluginOptions,
8+
} from '@tanstack/vue-query'
49
import { createPinia } from 'pinia'
510
import { PiniaColada } from '@pinia/colada'
611
import { router } from './router'
@@ -12,6 +17,11 @@ app.use(createPinia())
1217
app.use(PiniaColada, {})
1318
app.use(VueQueryPlugin, {
1419
queryClientConfig: {
20+
defaultOptions: {
21+
queries: {
22+
gcTime: 5000,
23+
},
24+
},
1525
mutationCache: new MutationCache({
1626
onSuccess(data, vars, context, mutation) {
1727
// debugger
@@ -26,7 +36,7 @@ app.use(VueQueryPlugin, {
2636
},
2737
}),
2838
},
29-
})
39+
} satisfies VueQueryPluginOptions)
3040
app.use(DataLoaderPlugin, { router })
3141
app.use(router)
3242

playground/src/pages/users/tq-query.[id].vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ const simulateError = ref(false)
2222
const enabled = ref(true)
2323
const queryClient = useQueryClient()
2424
window.qc = queryClient
25+
26+
// queryClient.setQueryData(['user-id', 1], {
27+
// id: 1,
28+
// name: 'Edu',
29+
// when: new Date().toUTCString(),
30+
// })
2531
// queryClient.prefetchQuery({
2632
// queryKey: ['user-id', computed(() => route.params.id)],
2733
// // queryFn: async () => {

0 commit comments

Comments
 (0)