@tanstack/vue-query 4.33.0 → 4.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lib/useBaseQuery.d.ts.map +1 -1
- package/build/lib/useBaseQuery.esm.js +7 -1
- package/build/lib/useBaseQuery.esm.js.map +1 -1
- package/build/lib/useBaseQuery.js +6 -0
- package/build/lib/useBaseQuery.js.map +1 -1
- package/build/lib/useBaseQuery.mjs +7 -1
- package/build/lib/useBaseQuery.mjs.map +1 -1
- package/build/lib/useIsFetching.d.ts.map +1 -1
- package/build/lib/useIsFetching.esm.js +7 -1
- package/build/lib/useIsFetching.esm.js.map +1 -1
- package/build/lib/useIsFetching.js +6 -0
- package/build/lib/useIsFetching.js.map +1 -1
- package/build/lib/useIsFetching.mjs +7 -1
- package/build/lib/useIsFetching.mjs.map +1 -1
- package/build/lib/useIsMutating.d.ts.map +1 -1
- package/build/lib/useIsMutating.esm.js +7 -1
- package/build/lib/useIsMutating.esm.js.map +1 -1
- package/build/lib/useIsMutating.js +6 -0
- package/build/lib/useIsMutating.js.map +1 -1
- package/build/lib/useIsMutating.mjs +7 -1
- package/build/lib/useIsMutating.mjs.map +1 -1
- package/build/lib/useMutation.d.ts.map +1 -1
- package/build/lib/useMutation.esm.js +7 -1
- package/build/lib/useMutation.esm.js.map +1 -1
- package/build/lib/useMutation.js +6 -0
- package/build/lib/useMutation.js.map +1 -1
- package/build/lib/useMutation.mjs +7 -1
- package/build/lib/useMutation.mjs.map +1 -1
- package/build/lib/useQueries.d.ts.map +1 -1
- package/build/lib/useQueries.esm.js +7 -1
- package/build/lib/useQueries.esm.js.map +1 -1
- package/build/lib/useQueries.js +6 -0
- package/build/lib/useQueries.js.map +1 -1
- package/build/lib/useQueries.mjs +7 -1
- package/build/lib/useQueries.mjs.map +1 -1
- package/build/lib/useQueryClient.d.ts.map +1 -1
- package/build/lib/useQueryClient.esm.js +9 -9
- package/build/lib/useQueryClient.esm.js.map +1 -1
- package/build/lib/useQueryClient.js +8 -8
- package/build/lib/useQueryClient.js.map +1 -1
- package/build/lib/useQueryClient.mjs +9 -9
- package/build/lib/useQueryClient.mjs.map +1 -1
- package/build/lib/vueQueryPlugin.d.ts +1 -0
- package/build/lib/vueQueryPlugin.d.ts.map +1 -1
- package/build/lib/vueQueryPlugin.esm.js +1 -0
- package/build/lib/vueQueryPlugin.esm.js.map +1 -1
- package/build/lib/vueQueryPlugin.js +1 -0
- package/build/lib/vueQueryPlugin.js.map +1 -1
- package/build/lib/vueQueryPlugin.mjs +1 -0
- package/build/lib/vueQueryPlugin.mjs.map +1 -1
- package/build/umd/index.development.js +39 -8
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vueQueryPlugin.js","sources":["../../src/vueQueryPlugin.ts"],"sourcesContent":["import { isVue2 } from 'vue-demi'\nimport { isServer } from '@tanstack/query-core'\n\nimport { QueryClient } from './queryClient'\nimport { getClientKey } from './utils'\nimport { setupDevtools } from './devtools/devtools'\nimport type { QueryClientConfig } from '@tanstack/query-core'\nimport type { MaybeRefDeep } from './types'\n\ndeclare global {\n interface Window {\n __VUE_QUERY_CONTEXT__?: QueryClient\n }\n}\n\ntype ClientPersister = (client: QueryClient) => [() => void, Promise<void>]\n\ninterface CommonOptions {\n queryClientKey?: string\n contextSharing?: boolean\n clientPersister?: ClientPersister\n}\n\ninterface ConfigOptions extends CommonOptions {\n queryClientConfig?: MaybeRefDeep<QueryClientConfig>\n}\n\ninterface ClientOptions extends CommonOptions {\n queryClient?: QueryClient\n}\n\nexport type VueQueryPluginOptions = ConfigOptions | ClientOptions\n\nexport const VueQueryPlugin = {\n install: (app: any, options: VueQueryPluginOptions = {}) => {\n const clientKey = getClientKey(options.queryClientKey)\n let client: QueryClient\n\n if ('queryClient' in options && options.queryClient) {\n client = options.queryClient\n } else {\n if (options.contextSharing && typeof window !== 'undefined') {\n if (!window.__VUE_QUERY_CONTEXT__) {\n const clientConfig =\n 'queryClientConfig' in options\n ? options.queryClientConfig\n : undefined\n client = new QueryClient(clientConfig)\n window.__VUE_QUERY_CONTEXT__ = client\n } else {\n client = window.__VUE_QUERY_CONTEXT__\n }\n } else {\n const clientConfig =\n 'queryClientConfig' in options ? options.queryClientConfig : undefined\n client = new QueryClient(clientConfig)\n }\n }\n\n if (!isServer) {\n client.mount()\n }\n\n let persisterUnmount = () => {\n // noop\n }\n\n if (options.clientPersister) {\n client.isRestoring.value = true\n const [unmount, promise] = options.clientPersister(client)\n persisterUnmount = unmount\n promise.then(() => {\n client.isRestoring.value = false\n })\n }\n\n if (process.env.NODE_ENV !== 'production' && options.contextSharing) {\n client\n .getLogger()\n .error(\n `The contextSharing option has been deprecated and will be removed in the next major version`,\n )\n }\n\n const cleanup = () => {\n client.unmount()\n persisterUnmount()\n }\n\n if (app.onUnmount) {\n app.onUnmount(cleanup)\n } else {\n const originalUnmount = app.unmount\n app.unmount = function vueQueryUnmount() {\n cleanup()\n originalUnmount()\n }\n }\n\n /* istanbul ignore next */\n if (isVue2) {\n app.mixin({\n beforeCreate() {\n // HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/master/src/apis/inject.ts#L30\n if (!this._provided) {\n const provideCache = {}\n Object.defineProperty(this, '_provided', {\n get: () => provideCache,\n set: (v) => Object.assign(provideCache, v),\n })\n }\n\n this._provided[clientKey] = client\n\n if (process.env.NODE_ENV === 'development') {\n if (this === this.$root) {\n setupDevtools(this, client)\n }\n }\n },\n })\n } else {\n app.provide(clientKey, client)\n\n if (process.env.NODE_ENV === 'development') {\n setupDevtools(app, client)\n }\n }\n },\n}\n"],"names":["VueQueryPlugin","install","app","options","clientKey","getClientKey","queryClientKey","client","queryClient","contextSharing","window","__VUE_QUERY_CONTEXT__","clientConfig","queryClientConfig","undefined","QueryClient","isServer","mount","persisterUnmount","clientPersister","isRestoring","value","unmount","promise","then","process","env","NODE_ENV","getLogger","error","cleanup","onUnmount","originalUnmount","vueQueryUnmount","isVue2","mixin","beforeCreate","_provided","provideCache","Object","defineProperty","get","set","v","assign","$root","setupDevtools","provide"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"vueQueryPlugin.js","sources":["../../src/vueQueryPlugin.ts"],"sourcesContent":["import { isVue2 } from 'vue-demi'\nimport { isServer } from '@tanstack/query-core'\n\nimport { QueryClient } from './queryClient'\nimport { getClientKey } from './utils'\nimport { setupDevtools } from './devtools/devtools'\nimport type { QueryClientConfig } from '@tanstack/query-core'\nimport type { MaybeRefDeep } from './types'\n\ndeclare global {\n interface Window {\n __VUE_QUERY_CONTEXT__?: QueryClient\n }\n}\n\ntype ClientPersister = (client: QueryClient) => [() => void, Promise<void>]\n\ninterface CommonOptions {\n queryClientKey?: string\n contextSharing?: boolean\n clientPersister?: ClientPersister\n clientPersisterOnSuccess?: (client: QueryClient) => void\n}\n\ninterface ConfigOptions extends CommonOptions {\n queryClientConfig?: MaybeRefDeep<QueryClientConfig>\n}\n\ninterface ClientOptions extends CommonOptions {\n queryClient?: QueryClient\n}\n\nexport type VueQueryPluginOptions = ConfigOptions | ClientOptions\n\nexport const VueQueryPlugin = {\n install: (app: any, options: VueQueryPluginOptions = {}) => {\n const clientKey = getClientKey(options.queryClientKey)\n let client: QueryClient\n\n if ('queryClient' in options && options.queryClient) {\n client = options.queryClient\n } else {\n if (options.contextSharing && typeof window !== 'undefined') {\n if (!window.__VUE_QUERY_CONTEXT__) {\n const clientConfig =\n 'queryClientConfig' in options\n ? options.queryClientConfig\n : undefined\n client = new QueryClient(clientConfig)\n window.__VUE_QUERY_CONTEXT__ = client\n } else {\n client = window.__VUE_QUERY_CONTEXT__\n }\n } else {\n const clientConfig =\n 'queryClientConfig' in options ? options.queryClientConfig : undefined\n client = new QueryClient(clientConfig)\n }\n }\n\n if (!isServer) {\n client.mount()\n }\n\n let persisterUnmount = () => {\n // noop\n }\n\n if (options.clientPersister) {\n client.isRestoring.value = true\n const [unmount, promise] = options.clientPersister(client)\n persisterUnmount = unmount\n promise.then(() => {\n client.isRestoring.value = false\n options.clientPersisterOnSuccess?.(client)\n })\n }\n\n if (process.env.NODE_ENV !== 'production' && options.contextSharing) {\n client\n .getLogger()\n .error(\n `The contextSharing option has been deprecated and will be removed in the next major version`,\n )\n }\n\n const cleanup = () => {\n client.unmount()\n persisterUnmount()\n }\n\n if (app.onUnmount) {\n app.onUnmount(cleanup)\n } else {\n const originalUnmount = app.unmount\n app.unmount = function vueQueryUnmount() {\n cleanup()\n originalUnmount()\n }\n }\n\n /* istanbul ignore next */\n if (isVue2) {\n app.mixin({\n beforeCreate() {\n // HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/master/src/apis/inject.ts#L30\n if (!this._provided) {\n const provideCache = {}\n Object.defineProperty(this, '_provided', {\n get: () => provideCache,\n set: (v) => Object.assign(provideCache, v),\n })\n }\n\n this._provided[clientKey] = client\n\n if (process.env.NODE_ENV === 'development') {\n if (this === this.$root) {\n setupDevtools(this, client)\n }\n }\n },\n })\n } else {\n app.provide(clientKey, client)\n\n if (process.env.NODE_ENV === 'development') {\n setupDevtools(app, client)\n }\n }\n },\n}\n"],"names":["VueQueryPlugin","install","app","options","clientKey","getClientKey","queryClientKey","client","queryClient","contextSharing","window","__VUE_QUERY_CONTEXT__","clientConfig","queryClientConfig","undefined","QueryClient","isServer","mount","persisterUnmount","clientPersister","isRestoring","value","unmount","promise","then","clientPersisterOnSuccess","process","env","NODE_ENV","getLogger","error","cleanup","onUnmount","originalUnmount","vueQueryUnmount","isVue2","mixin","beforeCreate","_provided","provideCache","Object","defineProperty","get","set","v","assign","$root","setupDevtools","provide"],"mappings":";;;;;;;;;;AAkCO,MAAMA,cAAc,GAAG;AAC5BC,EAAAA,OAAO,EAAE,CAACC,GAAD,EAAWC,OAA8B,GAAG,EAA5C,KAAmD;AAC1D,IAAA,MAAMC,SAAS,GAAGC,kBAAY,CAACF,OAAO,CAACG,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AA,IAAA,CAAKN,SAAL,CAAelC,SAAf,CAAA,GAA4BG,MAA5B,CAAA;;AAEA,UAAA,IAAImB,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,aAA7B,EAA4C;YAC1C,IAAI,IAAA,KAAS,IAAKkB,CAAAA,KAAlB,EAAyB;AACvBC,cAAAA,sBAAa,CAAC,IAAD,EAAOxC,MAAP,CAAb,CAAA;AACD,aAAA;AACF,WAAA;AACF,SAAA;;OAlBH,CAAA,CAAA;AAoBD,KArBD,MAqBO;AACLL,MAAAA,GAAG,CAAC8C,OAAJ,CAAY5C,SAAZ,EAAuBG,MAAvB,CAAA,CAAA;;AAEA,MAAA,IAAImB,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,aAA7B,EAA4C;AAC1CmB,QAAAA,sBAAa,CAAC7C,GAAD,EAAMK,MAAN,CAAb,CAAA;AACD,OAAA;AACF,KAAA;AACF,GAAA;AAhG2B;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vueQueryPlugin.mjs","sources":["../../src/vueQueryPlugin.ts"],"sourcesContent":["import { isVue2 } from 'vue-demi'\nimport { isServer } from '@tanstack/query-core'\n\nimport { QueryClient } from './queryClient'\nimport { getClientKey } from './utils'\nimport { setupDevtools } from './devtools/devtools'\nimport type { QueryClientConfig } from '@tanstack/query-core'\nimport type { MaybeRefDeep } from './types'\n\ndeclare global {\n interface Window {\n __VUE_QUERY_CONTEXT__?: QueryClient\n }\n}\n\ntype ClientPersister = (client: QueryClient) => [() => void, Promise<void>]\n\ninterface CommonOptions {\n queryClientKey?: string\n contextSharing?: boolean\n clientPersister?: ClientPersister\n}\n\ninterface ConfigOptions extends CommonOptions {\n queryClientConfig?: MaybeRefDeep<QueryClientConfig>\n}\n\ninterface ClientOptions extends CommonOptions {\n queryClient?: QueryClient\n}\n\nexport type VueQueryPluginOptions = ConfigOptions | ClientOptions\n\nexport const VueQueryPlugin = {\n install: (app: any, options: VueQueryPluginOptions = {}) => {\n const clientKey = getClientKey(options.queryClientKey)\n let client: QueryClient\n\n if ('queryClient' in options && options.queryClient) {\n client = options.queryClient\n } else {\n if (options.contextSharing && typeof window !== 'undefined') {\n if (!window.__VUE_QUERY_CONTEXT__) {\n const clientConfig =\n 'queryClientConfig' in options\n ? options.queryClientConfig\n : undefined\n client = new QueryClient(clientConfig)\n window.__VUE_QUERY_CONTEXT__ = client\n } else {\n client = window.__VUE_QUERY_CONTEXT__\n }\n } else {\n const clientConfig =\n 'queryClientConfig' in options ? options.queryClientConfig : undefined\n client = new QueryClient(clientConfig)\n }\n }\n\n if (!isServer) {\n client.mount()\n }\n\n let persisterUnmount = () => {\n // noop\n }\n\n if (options.clientPersister) {\n client.isRestoring.value = true\n const [unmount, promise] = options.clientPersister(client)\n persisterUnmount = unmount\n promise.then(() => {\n client.isRestoring.value = false\n })\n }\n\n if (process.env.NODE_ENV !== 'production' && options.contextSharing) {\n client\n .getLogger()\n .error(\n `The contextSharing option has been deprecated and will be removed in the next major version`,\n )\n }\n\n const cleanup = () => {\n client.unmount()\n persisterUnmount()\n }\n\n if (app.onUnmount) {\n app.onUnmount(cleanup)\n } else {\n const originalUnmount = app.unmount\n app.unmount = function vueQueryUnmount() {\n cleanup()\n originalUnmount()\n }\n }\n\n /* istanbul ignore next */\n if (isVue2) {\n app.mixin({\n beforeCreate() {\n // HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/master/src/apis/inject.ts#L30\n if (!this._provided) {\n const provideCache = {}\n Object.defineProperty(this, '_provided', {\n get: () => provideCache,\n set: (v) => Object.assign(provideCache, v),\n })\n }\n\n this._provided[clientKey] = client\n\n if (process.env.NODE_ENV === 'development') {\n if (this === this.$root) {\n setupDevtools(this, client)\n }\n }\n },\n })\n } else {\n app.provide(clientKey, client)\n\n if (process.env.NODE_ENV === 'development') {\n setupDevtools(app, client)\n }\n }\n },\n}\n"],"names":["VueQueryPlugin","install","app","options","clientKey","getClientKey","queryClientKey","client","queryClient","contextSharing","window","__VUE_QUERY_CONTEXT__","clientConfig","queryClientConfig","undefined","QueryClient","isServer","mount","persisterUnmount","clientPersister","isRestoring","value","unmount","promise","then","process","env","NODE_ENV","getLogger","error","cleanup","onUnmount","originalUnmount","vueQueryUnmount","isVue2","mixin","beforeCreate","_provided","provideCache","Object","defineProperty","get","set","v","assign","$root","setupDevtools","provide"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"vueQueryPlugin.mjs","sources":["../../src/vueQueryPlugin.ts"],"sourcesContent":["import { isVue2 } from 'vue-demi'\nimport { isServer } from '@tanstack/query-core'\n\nimport { QueryClient } from './queryClient'\nimport { getClientKey } from './utils'\nimport { setupDevtools } from './devtools/devtools'\nimport type { QueryClientConfig } from '@tanstack/query-core'\nimport type { MaybeRefDeep } from './types'\n\ndeclare global {\n interface Window {\n __VUE_QUERY_CONTEXT__?: QueryClient\n }\n}\n\ntype ClientPersister = (client: QueryClient) => [() => void, Promise<void>]\n\ninterface CommonOptions {\n queryClientKey?: string\n contextSharing?: boolean\n clientPersister?: ClientPersister\n clientPersisterOnSuccess?: (client: QueryClient) => void\n}\n\ninterface ConfigOptions extends CommonOptions {\n queryClientConfig?: MaybeRefDeep<QueryClientConfig>\n}\n\ninterface ClientOptions extends CommonOptions {\n queryClient?: QueryClient\n}\n\nexport type VueQueryPluginOptions = ConfigOptions | ClientOptions\n\nexport const VueQueryPlugin = {\n install: (app: any, options: VueQueryPluginOptions = {}) => {\n const clientKey = getClientKey(options.queryClientKey)\n let client: QueryClient\n\n if ('queryClient' in options && options.queryClient) {\n client = options.queryClient\n } else {\n if (options.contextSharing && typeof window !== 'undefined') {\n if (!window.__VUE_QUERY_CONTEXT__) {\n const clientConfig =\n 'queryClientConfig' in options\n ? options.queryClientConfig\n : undefined\n client = new QueryClient(clientConfig)\n window.__VUE_QUERY_CONTEXT__ = client\n } else {\n client = window.__VUE_QUERY_CONTEXT__\n }\n } else {\n const clientConfig =\n 'queryClientConfig' in options ? options.queryClientConfig : undefined\n client = new QueryClient(clientConfig)\n }\n }\n\n if (!isServer) {\n client.mount()\n }\n\n let persisterUnmount = () => {\n // noop\n }\n\n if (options.clientPersister) {\n client.isRestoring.value = true\n const [unmount, promise] = options.clientPersister(client)\n persisterUnmount = unmount\n promise.then(() => {\n client.isRestoring.value = false\n options.clientPersisterOnSuccess?.(client)\n })\n }\n\n if (process.env.NODE_ENV !== 'production' && options.contextSharing) {\n client\n .getLogger()\n .error(\n `The contextSharing option has been deprecated and will be removed in the next major version`,\n )\n }\n\n const cleanup = () => {\n client.unmount()\n persisterUnmount()\n }\n\n if (app.onUnmount) {\n app.onUnmount(cleanup)\n } else {\n const originalUnmount = app.unmount\n app.unmount = function vueQueryUnmount() {\n cleanup()\n originalUnmount()\n }\n }\n\n /* istanbul ignore next */\n if (isVue2) {\n app.mixin({\n beforeCreate() {\n // HACK: taken from provide(): https://github.com/vuejs/composition-api/blob/master/src/apis/inject.ts#L30\n if (!this._provided) {\n const provideCache = {}\n Object.defineProperty(this, '_provided', {\n get: () => provideCache,\n set: (v) => Object.assign(provideCache, v),\n })\n }\n\n this._provided[clientKey] = client\n\n if (process.env.NODE_ENV === 'development') {\n if (this === this.$root) {\n setupDevtools(this, client)\n }\n }\n },\n })\n } else {\n app.provide(clientKey, client)\n\n if (process.env.NODE_ENV === 'development') {\n setupDevtools(app, client)\n }\n }\n },\n}\n"],"names":["VueQueryPlugin","install","app","options","clientKey","getClientKey","queryClientKey","client","queryClient","contextSharing","window","__VUE_QUERY_CONTEXT__","clientConfig","queryClientConfig","undefined","QueryClient","isServer","mount","persisterUnmount","clientPersister","isRestoring","value","unmount","promise","then","clientPersisterOnSuccess","process","env","NODE_ENV","getLogger","error","cleanup","onUnmount","originalUnmount","vueQueryUnmount","isVue2","mixin","beforeCreate","_provided","provideCache","Object","defineProperty","get","set","v","assign","$root","setupDevtools","provide"],"mappings":";;;;;;AAkCO,MAAMA,cAAc,GAAG;AAC5BC,EAAAA,OAAO,EAAE,CAACC,GAAD,EAA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,CAACK,MAAP,CAAcN,YAAd,EAA4BK,CAA5B,CAAA;aAFd,CAAA,CAAA;AAID,WAAA;;AAED,UAAA,IAAA,CAAKN,SAAL,CAAelC,SAAf,CAAA,GAA4BG,MAA5B,CAAA;;AAEA,UAAA,IAAImB,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,aAA7B,EAA4C;YAC1C,IAAI,IAAA,KAAS,IAAKkB,CAAAA,KAAlB,EAAyB;AACvBC,cAAAA,aAAa,CAAC,IAAD,EAAOxC,MAAP,CAAb,CAAA;AACD,aAAA;AACF,WAAA;AACF,SAAA;;OAlBH,CAAA,CAAA;AAoBD,KArBD,MAqBO;AACLL,MAAAA,GAAG,CAAC8C,OAAJ,CAAY5C,SAAZ,EAAuBG,MAAvB,CAAA,CAAA;;AAEA,MAAA,IAAImB,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,aAA7B,EAA4C;AAC1CmB,QAAAA,aAAa,CAAC7C,GAAD,EAAMK,MAAN,CAAb,CAAA;AACD,OAAA;AACF,KAAA;AACF,GAAA;AAhG2B;;;;"}
|
|
@@ -3328,18 +3328,18 @@
|
|
|
3328
3328
|
}
|
|
3329
3329
|
|
|
3330
3330
|
function useQueryClient(id = '') {
|
|
3331
|
-
|
|
3331
|
+
const key = getClientKey(id);
|
|
3332
|
+
const queryClient = vueDemi.inject(key, null);
|
|
3332
3333
|
|
|
3333
|
-
|
|
3334
|
+
if (!queryClient) {
|
|
3335
|
+
var _getCurrentInstance;
|
|
3334
3336
|
|
|
3335
|
-
|
|
3336
|
-
throw new Error('vue-query hooks can only be used inside setup() function.');
|
|
3337
|
-
}
|
|
3337
|
+
const vm = (_getCurrentInstance = vueDemi.getCurrentInstance()) == null ? void 0 : _getCurrentInstance.proxy;
|
|
3338
3338
|
|
|
3339
|
-
|
|
3340
|
-
|
|
3339
|
+
if (!vm) {
|
|
3340
|
+
throw new Error('vue-query hooks can only be used inside setup() function.');
|
|
3341
|
+
}
|
|
3341
3342
|
|
|
3342
|
-
if (!queryClient) {
|
|
3343
3343
|
throw new Error("No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.");
|
|
3344
3344
|
}
|
|
3345
3345
|
|
|
@@ -4731,6 +4731,7 @@
|
|
|
4731
4731
|
persisterUnmount = unmount;
|
|
4732
4732
|
promise.then(() => {
|
|
4733
4733
|
client.isRestoring.value = false;
|
|
4734
|
+
options.clientPersisterOnSuccess == null ? void 0 : options.clientPersisterOnSuccess(client);
|
|
4734
4735
|
});
|
|
4735
4736
|
}
|
|
4736
4737
|
|
|
@@ -4791,6 +4792,12 @@
|
|
|
4791
4792
|
function useBaseQuery(Observer, arg1, arg2 = {}, arg3 = {}) {
|
|
4792
4793
|
var _options$value$queryC;
|
|
4793
4794
|
|
|
4795
|
+
{
|
|
4796
|
+
if (!vueDemi.getCurrentScope()) {
|
|
4797
|
+
console.warn('vue-query composables like "uesQuery()" should only be used inside a "setup()" function or a running effect scope. They might otherwise lead to memory leaks.');
|
|
4798
|
+
}
|
|
4799
|
+
}
|
|
4800
|
+
|
|
4794
4801
|
const options = vueDemi.computed(() => parseQueryArgs(arg1, arg2, arg3));
|
|
4795
4802
|
const queryClient = (_options$value$queryC = options.value.queryClient) != null ? _options$value$queryC : useQueryClient(options.value.queryClientKey);
|
|
4796
4803
|
const defaultedOptions = vueDemi.computed(() => {
|
|
@@ -4896,6 +4903,12 @@
|
|
|
4896
4903
|
}) {
|
|
4897
4904
|
var _unreffedQueries$valu, _unreffedQueries$valu2, _ref;
|
|
4898
4905
|
|
|
4906
|
+
{
|
|
4907
|
+
if (!vueDemi.getCurrentScope()) {
|
|
4908
|
+
console.warn('vue-query composables like "uesQuery()" should only be used inside a "setup()" function or a running effect scope. They might otherwise lead to memory leaks.');
|
|
4909
|
+
}
|
|
4910
|
+
}
|
|
4911
|
+
|
|
4899
4912
|
const unreffedQueries = vueDemi.computed(() => cloneDeepUnref(queries));
|
|
4900
4913
|
const queryClientKey = (_unreffedQueries$valu = unreffedQueries.value[0]) == null ? void 0 : _unreffedQueries$valu.queryClientKey;
|
|
4901
4914
|
const optionsQueryClient = (_unreffedQueries$valu2 = unreffedQueries.value[0]) == null ? void 0 : _unreffedQueries$valu2.queryClient;
|
|
@@ -4951,6 +4964,12 @@
|
|
|
4951
4964
|
function useMutation(arg1, arg2, arg3) {
|
|
4952
4965
|
var _options$value$queryC;
|
|
4953
4966
|
|
|
4967
|
+
{
|
|
4968
|
+
if (!vueDemi.getCurrentScope()) {
|
|
4969
|
+
console.warn('vue-query composables like "uesQuery()" should only be used inside a "setup()" function or a running effect scope. They might otherwise lead to memory leaks.');
|
|
4970
|
+
}
|
|
4971
|
+
}
|
|
4972
|
+
|
|
4954
4973
|
const options = vueDemi.computed(() => {
|
|
4955
4974
|
return parseMutationArgs(arg1, arg2, arg3);
|
|
4956
4975
|
});
|
|
@@ -5015,6 +5034,12 @@
|
|
|
5015
5034
|
function useIsFetching(arg1, arg2) {
|
|
5016
5035
|
var _filters$value$queryC;
|
|
5017
5036
|
|
|
5037
|
+
{
|
|
5038
|
+
if (!vueDemi.getCurrentScope()) {
|
|
5039
|
+
console.warn('vue-query composables like "uesQuery()" should only be used inside a "setup()" function or a running effect scope. They might otherwise lead to memory leaks.');
|
|
5040
|
+
}
|
|
5041
|
+
}
|
|
5042
|
+
|
|
5018
5043
|
const filters = vueDemi.computed(() => parseFilterArgs$1(arg1, arg2));
|
|
5019
5044
|
const queryClient = (_filters$value$queryC = filters.value.queryClient) != null ? _filters$value$queryC : useQueryClient(filters.value.queryClientKey);
|
|
5020
5045
|
const isFetching = vueDemi.ref(queryClient.isFetching(filters));
|
|
@@ -5049,6 +5074,12 @@
|
|
|
5049
5074
|
function useIsMutating(arg1, arg2) {
|
|
5050
5075
|
var _filters$value$queryC;
|
|
5051
5076
|
|
|
5077
|
+
{
|
|
5078
|
+
if (!vueDemi.getCurrentScope()) {
|
|
5079
|
+
console.warn('vue-query composables like "uesQuery()" should only be used inside a "setup()" function or a running effect scope. They might otherwise lead to memory leaks.');
|
|
5080
|
+
}
|
|
5081
|
+
}
|
|
5082
|
+
|
|
5052
5083
|
const filters = vueDemi.computed(() => parseFilterArgs(arg1, arg2));
|
|
5053
5084
|
const queryClient = (_filters$value$queryC = filters.value.queryClient) != null ? _filters$value$queryC : useQueryClient(filters.value.queryClientKey);
|
|
5054
5085
|
const isMutating = vueDemi.ref(queryClient.isMutating(filters));
|