You've already forked AstralRinth
forked from didirus/AstralRinth
* feat: ssr fixes * feat: lazy load non-core data * feat: ssr timing debugging * feat: go back to all parallel * feat: migrate to DI + set up mutators * feat: remove double get versions request, only call v3 * refactor: [version].vue page to use composition API and typescript * feat: gallery.vue start * fix: remove left behind console log * fix: type issues + gallery * fix: versionsummary modal + version page direct join * fix: projectRaw guard * fix: currentMember val fix * fix: actualProjectType * fix: vers summary link same page * fix: lint --------- Co-authored-by: tdgao <mr.trumgao@gmail.com>
15 lines
443 B
TypeScript
15 lines
443 B
TypeScript
import type { QueryClient } from '@tanstack/vue-query'
|
|
import { useQueryClient } from '@tanstack/vue-query'
|
|
import { getCurrentInstance } from 'vue'
|
|
|
|
export function useAppQueryClient(): QueryClient {
|
|
// In components, use the standard composable
|
|
if (getCurrentInstance()) {
|
|
return useQueryClient()
|
|
}
|
|
|
|
// In middleware/server context, use the provided instance
|
|
const nuxtApp = useNuxtApp()
|
|
return nuxtApp.$queryClient as QueryClient
|
|
}
|