File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { createApp } from 'vue'
2
2
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'
4
9
import { createPinia } from 'pinia'
5
10
import { PiniaColada } from '@pinia/colada'
6
11
import { router } from './router'
@@ -12,6 +17,11 @@ app.use(createPinia())
12
17
app . use ( PiniaColada , { } )
13
18
app . use ( VueQueryPlugin , {
14
19
queryClientConfig : {
20
+ defaultOptions : {
21
+ queries : {
22
+ gcTime : 5000 ,
23
+ } ,
24
+ } ,
15
25
mutationCache : new MutationCache ( {
16
26
onSuccess ( data , vars , context , mutation ) {
17
27
// debugger
@@ -26,7 +36,7 @@ app.use(VueQueryPlugin, {
26
36
} ,
27
37
} ) ,
28
38
} ,
29
- } )
39
+ } satisfies VueQueryPluginOptions )
30
40
app . use ( DataLoaderPlugin , { router } )
31
41
app . use ( router )
32
42
Original file line number Diff line number Diff line change @@ -22,6 +22,12 @@ const simulateError = ref(false)
22
22
const enabled = ref (true )
23
23
const queryClient = useQueryClient ()
24
24
window .qc = queryClient
25
+
26
+ // queryClient.setQueryData(['user-id', 1], {
27
+ // id: 1,
28
+ // name: 'Edu',
29
+ // when: new Date().toUTCString(),
30
+ // })
25
31
// queryClient.prefetchQuery({
26
32
// queryKey: ['user-id', computed(() => route.params.id)],
27
33
// // queryFn: async () => {
You can’t perform that action at this time.
0 commit comments