Skip to content

Commit 6d159a7

Browse files
authored
fix(vue-query): reduce unnecessary type flexibility on QueryClient options (#5986)
1 parent 6a14854 commit 6d159a7

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

packages/vue-query/src/queryClient.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,11 @@ import type {
2929
} from '@tanstack/query-core'
3030

3131
export class QueryClient extends QC {
32-
constructor(config: MaybeRefDeep<QueryClientConfig> = {}) {
33-
const unreffedConfig = cloneDeepUnref(config)
34-
const vueQueryConfig: QueryClientConfig = {
35-
defaultOptions: unreffedConfig.defaultOptions,
36-
queryCache: unreffedConfig.queryCache || new QueryCache(),
37-
mutationCache: unreffedConfig.mutationCache || new MutationCache(),
32+
constructor(config: QueryClientConfig = {}) {
33+
const vueQueryConfig = {
34+
defaultOptions: config.defaultOptions,
35+
queryCache: config.queryCache || new QueryCache(),
36+
mutationCache: config.mutationCache || new MutationCache(),
3837
}
3938
super(vueQueryConfig)
4039
}

packages/vue-query/src/vueQueryPlugin.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { QueryClient } from './queryClient'
55
import { getClientKey } from './utils'
66
import { setupDevtools } from './devtools/devtools'
77
import type { QueryClientConfig } from '@tanstack/query-core'
8-
import type { MaybeRefDeep } from './types'
98

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

@@ -16,7 +15,7 @@ interface CommonOptions {
1615
}
1716

1817
interface ConfigOptions extends CommonOptions {
19-
queryClientConfig?: MaybeRefDeep<QueryClientConfig>
18+
queryClientConfig?: QueryClientConfig
2019
}
2120

2221
interface ClientOptions extends CommonOptions {

0 commit comments

Comments
 (0)