Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions packages/vue-query/src/queryClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,11 @@ import type {
} from '@tanstack/query-core'

export class QueryClient extends QC {
constructor(config: MaybeRefDeep<QueryClientConfig> = {}) {
const unreffedConfig = cloneDeepUnref(config)
const vueQueryConfig: QueryClientConfig = {
defaultOptions: unreffedConfig.defaultOptions,
queryCache: unreffedConfig.queryCache || new QueryCache(),
mutationCache: unreffedConfig.mutationCache || new MutationCache(),
constructor(config: QueryClientConfig = {}) {
const vueQueryConfig = {
defaultOptions: config.defaultOptions,
queryCache: config.queryCache || new QueryCache(),
mutationCache: config.mutationCache || new MutationCache(),
}
super(vueQueryConfig)
}
Expand Down
3 changes: 1 addition & 2 deletions packages/vue-query/src/vueQueryPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { QueryClient } from './queryClient'
import { getClientKey } from './utils'
import { setupDevtools } from './devtools/devtools'
import type { QueryClientConfig } from '@tanstack/query-core'
import type { MaybeRefDeep } from './types'

type ClientPersister = (client: QueryClient) => [() => void, Promise<void>]

Expand All @@ -16,7 +15,7 @@ interface CommonOptions {
}

interface ConfigOptions extends CommonOptions {
queryClientConfig?: MaybeRefDeep<QueryClientConfig>
queryClientConfig?: QueryClientConfig
}

interface ClientOptions extends CommonOptions {
Expand Down