Skip to content

Commit 27c5a92

Browse files
committed
chore: playground
1 parent d76fb2c commit 27c5a92

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

playground/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"build": "vite build"
88
},
99
"devDependencies": {
10+
"@tanstack/vue-query-devtools": "^5.69.0",
1011
"@vitejs/plugin-vue": "^5.2.1",
1112
"@vue/compiler-sfc": "^3.5.13",
1213
"@vue/tsconfig": "^0.7.0",

playground/src/App.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import { useMutationState, useQueryClient } from '@tanstack/vue-query'
1212
console.log(`We have ${routes.length} routes.`)
1313
1414
const queryClient = useQueryClient()
15-
const states = useMutationState({ filters: { mutationKey: ['hey'] } })
15+
// const states = useMutationState({ filters: { mutationKey: ['hey'] } })
16+
const states = useMutationState()
1617
watch(states, () => {
1718
window.ss = states
1819
})

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

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const delay = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms))
44

55
<script lang="ts" setup>
66
import { computed, ref } from 'vue'
7+
import { VueQueryDevtools } from '@tanstack/vue-query-devtools'
78
import {
89
useQuery,
910
useQueries,
@@ -20,6 +21,7 @@ const simulateError = ref(false)
2021
2122
const enabled = ref(true)
2223
const queryClient = useQueryClient()
24+
window.qc = queryClient
2325
// queryClient.prefetchQuery({
2426
// queryKey: ['user-id', computed(() => route.params.id)],
2527
// // queryFn: async () => {
@@ -119,6 +121,7 @@ const {
119121
await delay(5000)
120122
return 'hey'
121123
},
124+
// gcTime: 5_000,
122125
})
123126
</script>
124127

@@ -176,4 +179,6 @@ const {
176179
<pre v-if="tqError">Error: {{ tqError }}</pre>
177180
<pre>data: {{ tqUser == null ? String(tqUser) : tqUser }}</pre>
178181
</main>
182+
183+
<VueQueryDevtools />
179184
</template>

pnpm-lock.yaml

+20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)