react-query-kit 2.0.9-beta.0 → 3.0.0-beta.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/README.md +105 -48
- package/build/lib/createBaseQuery.d.ts +2 -6
- package/build/lib/createBaseQuery.esm.js +19 -12
- package/build/lib/createBaseQuery.esm.js.map +1 -1
- package/build/lib/createBaseQuery.js +19 -12
- package/build/lib/createBaseQuery.js.map +1 -1
- package/build/lib/createBaseQuery.mjs +19 -12
- package/build/lib/createBaseQuery.mjs.map +1 -1
- package/build/lib/createMutation.d.ts +1 -1
- package/build/lib/createMutation.esm.js +2 -3
- package/build/lib/createMutation.esm.js.map +1 -1
- package/build/lib/createMutation.js +2 -3
- package/build/lib/createMutation.js.map +1 -1
- package/build/lib/createMutation.mjs +2 -3
- package/build/lib/createMutation.mjs.map +1 -1
- package/build/lib/createQuery.esm.js.map +1 -1
- package/build/lib/createQuery.js.map +1 -1
- package/build/lib/createQuery.mjs.map +1 -1
- package/build/lib/createSuspenseInfiniteQuery.esm.js +1 -1
- package/build/lib/createSuspenseInfiniteQuery.esm.js.map +1 -1
- package/build/lib/createSuspenseInfiniteQuery.js +1 -1
- package/build/lib/createSuspenseInfiniteQuery.js.map +1 -1
- package/build/lib/createSuspenseInfiniteQuery.mjs +1 -1
- package/build/lib/createSuspenseInfiniteQuery.mjs.map +1 -1
- package/build/lib/createSuspenseQuery.esm.js +1 -1
- package/build/lib/createSuspenseQuery.esm.js.map +1 -1
- package/build/lib/createSuspenseQuery.js +1 -1
- package/build/lib/createSuspenseQuery.js.map +1 -1
- package/build/lib/createSuspenseQuery.mjs +1 -1
- package/build/lib/createSuspenseQuery.mjs.map +1 -1
- package/build/lib/types.d.ts +35 -50
- package/build/lib/utils.d.ts +9 -8
- package/build/lib/utils.esm.js +10 -10
- package/build/lib/utils.esm.js.map +1 -1
- package/build/lib/utils.js +10 -10
- package/build/lib/utils.js.map +1 -1
- package/build/lib/utils.mjs +10 -10
- package/build/lib/utils.mjs.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats.json +96 -96
- package/build/umd/index.development.js +33 -27
- 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/build/zip/zip.esm.js +1 -1
- package/package.json +1 -1
- package/src/createBaseQuery.ts +25 -14
- package/src/createMutation.ts +4 -5
- package/src/createSuspenseInfiniteQuery.ts +1 -1
- package/src/createSuspenseQuery.ts +1 -1
- package/src/types.ts +96 -168
- package/src/utils.ts +17 -21
- /package/src/{createQuery.tsx → createQuery.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createMutation.mjs","sources":["../../src/createMutation.ts"],"sourcesContent":["import * as ReactQuery from '@tanstack/react-query'\n\nimport type {\n CompatibleError,\n CreateMutationOptions,\n MutationHook,\n} from './types'\nimport { withMiddleware } from './utils'\n\nexport const createMutation = <\n TData = unknown,\n TVariables = void,\n TError = CompatibleError,\n TContext = unknown\n>(\n defaultOptions: CreateMutationOptions<TData, TVariables, TError, TContext>\n): MutationHook<TData, TVariables, TError> => {\n
|
|
1
|
+
{"version":3,"file":"createMutation.mjs","sources":["../../src/createMutation.ts"],"sourcesContent":["import * as ReactQuery from '@tanstack/react-query'\n\nimport type {\n CompatibleError,\n CreateMutationOptions,\n MutationHook,\n} from './types'\nimport { withMiddleware } from './utils'\n\nexport const createMutation = <\n TData = unknown,\n TVariables = void,\n TError = CompatibleError,\n TContext = unknown\n>(\n defaultOptions: CreateMutationOptions<TData, TVariables, TError, TContext>\n): MutationHook<TData, TVariables, TError, TContext> => {\n return Object.assign(\n withMiddleware(ReactQuery.useMutation, defaultOptions, 'mutations'),\n {\n getKey: () => defaultOptions.mutationKey,\n getOptions: () => defaultOptions,\n mutationFn: defaultOptions.mutationFn,\n }\n ) as MutationHook<TData, TVariables, TError, TContext>\n}\n"],"names":["createMutation","defaultOptions","Object","assign","withMiddleware","ReactQuery","useMutation","getKey","mutationKey","getOptions","mutationFn"],"mappings":";;;AASaA,MAAAA,cAAc,GAMzBC,cAN4B,IAO0B;AACtD,EAAA,OAAOC,MAAM,CAACC,MAAP,CACLC,cAAc,CAACC,UAAU,CAACC,WAAZ,EAAyBL,cAAzB,EAAyC,WAAzC,CADT,EAEL;AACEM,IAAAA,MAAM,EAAE,MAAMN,cAAc,CAACO,WAD/B;IAEEC,UAAU,EAAE,MAAMR,cAFpB;IAGES,UAAU,EAAET,cAAc,CAACS,UAAAA;AAH7B,GAFK,CAAP,CAAA;AAQD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createQuery.esm.js","sources":["../../src/createQuery.
|
|
1
|
+
{"version":3,"file":"createQuery.esm.js","sources":["../../src/createQuery.ts"],"sourcesContent":["import * as ReactQuery from '@tanstack/react-query'\n\nimport { createBaseQuery } from './createBaseQuery'\nimport type { CompatibleError, CreateQueryOptions, QueryHook } from './types'\n\nexport const createQuery = <\n TFnData,\n TVariables = void,\n TError = CompatibleError\n>(\n options: CreateQueryOptions<TFnData, TVariables, TError>\n): QueryHook<TFnData, TVariables, TError> => {\n return createBaseQuery(options, ReactQuery.useQuery)\n}\n"],"names":["createQuery","options","createBaseQuery","ReactQuery","useQuery"],"mappings":";;;AAKaA,MAAAA,WAAW,GAKtBC,OALyB,IAMkB;AAC3C,EAAA,OAAOC,eAAe,CAACD,OAAD,EAAUE,UAAU,CAACC,QAArB,CAAtB,CAAA;AACD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createQuery.js","sources":["../../src/createQuery.
|
|
1
|
+
{"version":3,"file":"createQuery.js","sources":["../../src/createQuery.ts"],"sourcesContent":["import * as ReactQuery from '@tanstack/react-query'\n\nimport { createBaseQuery } from './createBaseQuery'\nimport type { CompatibleError, CreateQueryOptions, QueryHook } from './types'\n\nexport const createQuery = <\n TFnData,\n TVariables = void,\n TError = CompatibleError\n>(\n options: CreateQueryOptions<TFnData, TVariables, TError>\n): QueryHook<TFnData, TVariables, TError> => {\n return createBaseQuery(options, ReactQuery.useQuery)\n}\n"],"names":["createQuery","options","createBaseQuery","ReactQuery","useQuery"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAKaA,MAAAA,WAAW,GAKtBC,OALyB,IAMkB;AAC3C,EAAA,OAAOC,+BAAe,CAACD,OAAD,EAAUE,qBAAU,CAACC,QAArB,CAAtB,CAAA;AACD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createQuery.mjs","sources":["../../src/createQuery.
|
|
1
|
+
{"version":3,"file":"createQuery.mjs","sources":["../../src/createQuery.ts"],"sourcesContent":["import * as ReactQuery from '@tanstack/react-query'\n\nimport { createBaseQuery } from './createBaseQuery'\nimport type { CompatibleError, CreateQueryOptions, QueryHook } from './types'\n\nexport const createQuery = <\n TFnData,\n TVariables = void,\n TError = CompatibleError\n>(\n options: CreateQueryOptions<TFnData, TVariables, TError>\n): QueryHook<TFnData, TVariables, TError> => {\n return createBaseQuery(options, ReactQuery.useQuery)\n}\n"],"names":["createQuery","options","createBaseQuery","ReactQuery","useQuery"],"mappings":";;;AAKaA,MAAAA,WAAW,GAKtBC,OALyB,IAMkB;AAC3C,EAAA,OAAOC,eAAe,CAACD,OAAD,EAAUE,UAAU,CAACC,QAArB,CAAtB,CAAA;AACD;;;;"}
|
|
@@ -3,7 +3,7 @@ import { createBaseQuery } from './createBaseQuery.esm.js';
|
|
|
3
3
|
import { isV5, suspenseOptions } from './utils.esm.js';
|
|
4
4
|
|
|
5
5
|
const createSuspenseInfiniteQuery = options => {
|
|
6
|
-
return isV5
|
|
6
|
+
return isV5 ? createBaseQuery(options, ReactQuery.useSuspenseInfiniteQuery) : createBaseQuery(options, ReactQuery.useInfiniteQuery, suspenseOptions);
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
export { createSuspenseInfiniteQuery };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSuspenseInfiniteQuery.esm.js","sources":["../../src/createSuspenseInfiniteQuery.ts"],"sourcesContent":["import * as ReactQuery from '@tanstack/react-query'\n\nimport { createBaseQuery } from './createBaseQuery'\nimport type {\n CompatibleError,\n CreateSuspenseInfiniteQueryOptions,\n SuspenseInfiniteQueryHook,\n} from './types'\nimport { isV5, suspenseOptions } from './utils'\n\nexport const createSuspenseInfiniteQuery = <\n TFnData,\n TVariables = void,\n TError = CompatibleError,\n TPageParam = number\n>(\n options: CreateSuspenseInfiniteQueryOptions<\n TFnData,\n TVariables,\n TError,\n TPageParam\n >\n): SuspenseInfiniteQueryHook<TFnData, TVariables, TError, TPageParam> => {\n return isV5
|
|
1
|
+
{"version":3,"file":"createSuspenseInfiniteQuery.esm.js","sources":["../../src/createSuspenseInfiniteQuery.ts"],"sourcesContent":["import * as ReactQuery from '@tanstack/react-query'\n\nimport { createBaseQuery } from './createBaseQuery'\nimport type {\n CompatibleError,\n CreateSuspenseInfiniteQueryOptions,\n SuspenseInfiniteQueryHook,\n} from './types'\nimport { isV5, suspenseOptions } from './utils'\n\nexport const createSuspenseInfiniteQuery = <\n TFnData,\n TVariables = void,\n TError = CompatibleError,\n TPageParam = number\n>(\n options: CreateSuspenseInfiniteQueryOptions<\n TFnData,\n TVariables,\n TError,\n TPageParam\n >\n): SuspenseInfiniteQueryHook<TFnData, TVariables, TError, TPageParam> => {\n return isV5\n ? createBaseQuery(options, ReactQuery.useSuspenseInfiniteQuery)\n : createBaseQuery(options, ReactQuery.useInfiniteQuery, suspenseOptions)\n}\n"],"names":["createSuspenseInfiniteQuery","options","isV5","createBaseQuery","ReactQuery","useSuspenseInfiniteQuery","useInfiniteQuery","suspenseOptions"],"mappings":";;;;AAUaA,MAAAA,2BAA2B,GAMtCC,OANyC,IAY8B;EACvE,OAAOC,IAAI,GACPC,eAAe,CAACF,OAAD,EAAUG,UAAU,CAACC,wBAArB,CADR,GAEPF,eAAe,CAACF,OAAD,EAAUG,UAAU,CAACE,gBAArB,EAAuCC,eAAvC,CAFnB,CAAA;AAGD;;;;"}
|
|
@@ -27,7 +27,7 @@ function _interopNamespace(e) {
|
|
|
27
27
|
var ReactQuery__namespace = /*#__PURE__*/_interopNamespace(ReactQuery);
|
|
28
28
|
|
|
29
29
|
const createSuspenseInfiniteQuery = options => {
|
|
30
|
-
return utils.isV5
|
|
30
|
+
return utils.isV5 ? createBaseQuery.createBaseQuery(options, ReactQuery__namespace.useSuspenseInfiniteQuery) : createBaseQuery.createBaseQuery(options, ReactQuery__namespace.useInfiniteQuery, utils.suspenseOptions);
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
exports.createSuspenseInfiniteQuery = createSuspenseInfiniteQuery;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSuspenseInfiniteQuery.js","sources":["../../src/createSuspenseInfiniteQuery.ts"],"sourcesContent":["import * as ReactQuery from '@tanstack/react-query'\n\nimport { createBaseQuery } from './createBaseQuery'\nimport type {\n CompatibleError,\n CreateSuspenseInfiniteQueryOptions,\n SuspenseInfiniteQueryHook,\n} from './types'\nimport { isV5, suspenseOptions } from './utils'\n\nexport const createSuspenseInfiniteQuery = <\n TFnData,\n TVariables = void,\n TError = CompatibleError,\n TPageParam = number\n>(\n options: CreateSuspenseInfiniteQueryOptions<\n TFnData,\n TVariables,\n TError,\n TPageParam\n >\n): SuspenseInfiniteQueryHook<TFnData, TVariables, TError, TPageParam> => {\n return isV5
|
|
1
|
+
{"version":3,"file":"createSuspenseInfiniteQuery.js","sources":["../../src/createSuspenseInfiniteQuery.ts"],"sourcesContent":["import * as ReactQuery from '@tanstack/react-query'\n\nimport { createBaseQuery } from './createBaseQuery'\nimport type {\n CompatibleError,\n CreateSuspenseInfiniteQueryOptions,\n SuspenseInfiniteQueryHook,\n} from './types'\nimport { isV5, suspenseOptions } from './utils'\n\nexport const createSuspenseInfiniteQuery = <\n TFnData,\n TVariables = void,\n TError = CompatibleError,\n TPageParam = number\n>(\n options: CreateSuspenseInfiniteQueryOptions<\n TFnData,\n TVariables,\n TError,\n TPageParam\n >\n): SuspenseInfiniteQueryHook<TFnData, TVariables, TError, TPageParam> => {\n return isV5\n ? createBaseQuery(options, ReactQuery.useSuspenseInfiniteQuery)\n : createBaseQuery(options, ReactQuery.useInfiniteQuery, suspenseOptions)\n}\n"],"names":["createSuspenseInfiniteQuery","options","isV5","createBaseQuery","ReactQuery","useSuspenseInfiniteQuery","useInfiniteQuery","suspenseOptions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUaA,MAAAA,2BAA2B,GAMtCC,OANyC,IAY8B;EACvE,OAAOC,UAAI,GACPC,+BAAe,CAACF,OAAD,EAAUG,qBAAU,CAACC,wBAArB,CADR,GAEPF,+BAAe,CAACF,OAAD,EAAUG,qBAAU,CAACE,gBAArB,EAAuCC,qBAAvC,CAFnB,CAAA;AAGD;;;;"}
|
|
@@ -3,7 +3,7 @@ import { createBaseQuery } from './createBaseQuery.mjs';
|
|
|
3
3
|
import { isV5, suspenseOptions } from './utils.mjs';
|
|
4
4
|
|
|
5
5
|
const createSuspenseInfiniteQuery = options => {
|
|
6
|
-
return isV5
|
|
6
|
+
return isV5 ? createBaseQuery(options, ReactQuery.useSuspenseInfiniteQuery) : createBaseQuery(options, ReactQuery.useInfiniteQuery, suspenseOptions);
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
export { createSuspenseInfiniteQuery };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSuspenseInfiniteQuery.mjs","sources":["../../src/createSuspenseInfiniteQuery.ts"],"sourcesContent":["import * as ReactQuery from '@tanstack/react-query'\n\nimport { createBaseQuery } from './createBaseQuery'\nimport type {\n CompatibleError,\n CreateSuspenseInfiniteQueryOptions,\n SuspenseInfiniteQueryHook,\n} from './types'\nimport { isV5, suspenseOptions } from './utils'\n\nexport const createSuspenseInfiniteQuery = <\n TFnData,\n TVariables = void,\n TError = CompatibleError,\n TPageParam = number\n>(\n options: CreateSuspenseInfiniteQueryOptions<\n TFnData,\n TVariables,\n TError,\n TPageParam\n >\n): SuspenseInfiniteQueryHook<TFnData, TVariables, TError, TPageParam> => {\n return isV5
|
|
1
|
+
{"version":3,"file":"createSuspenseInfiniteQuery.mjs","sources":["../../src/createSuspenseInfiniteQuery.ts"],"sourcesContent":["import * as ReactQuery from '@tanstack/react-query'\n\nimport { createBaseQuery } from './createBaseQuery'\nimport type {\n CompatibleError,\n CreateSuspenseInfiniteQueryOptions,\n SuspenseInfiniteQueryHook,\n} from './types'\nimport { isV5, suspenseOptions } from './utils'\n\nexport const createSuspenseInfiniteQuery = <\n TFnData,\n TVariables = void,\n TError = CompatibleError,\n TPageParam = number\n>(\n options: CreateSuspenseInfiniteQueryOptions<\n TFnData,\n TVariables,\n TError,\n TPageParam\n >\n): SuspenseInfiniteQueryHook<TFnData, TVariables, TError, TPageParam> => {\n return isV5\n ? createBaseQuery(options, ReactQuery.useSuspenseInfiniteQuery)\n : createBaseQuery(options, ReactQuery.useInfiniteQuery, suspenseOptions)\n}\n"],"names":["createSuspenseInfiniteQuery","options","isV5","createBaseQuery","ReactQuery","useSuspenseInfiniteQuery","useInfiniteQuery","suspenseOptions"],"mappings":";;;;AAUaA,MAAAA,2BAA2B,GAMtCC,OANyC,IAY8B;EACvE,OAAOC,IAAI,GACPC,eAAe,CAACF,OAAD,EAAUG,UAAU,CAACC,wBAArB,CADR,GAEPF,eAAe,CAACF,OAAD,EAAUG,UAAU,CAACE,gBAArB,EAAuCC,eAAvC,CAFnB,CAAA;AAGD;;;;"}
|
|
@@ -3,7 +3,7 @@ import { createBaseQuery } from './createBaseQuery.esm.js';
|
|
|
3
3
|
import { isV5, suspenseOptions } from './utils.esm.js';
|
|
4
4
|
|
|
5
5
|
const createSuspenseQuery = options => {
|
|
6
|
-
return isV5
|
|
6
|
+
return isV5 ? createBaseQuery(options, ReactQuery.useSuspenseQuery) : createBaseQuery(options, ReactQuery.useQuery, suspenseOptions);
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
export { createSuspenseQuery };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSuspenseQuery.esm.js","sources":["../../src/createSuspenseQuery.ts"],"sourcesContent":["import * as ReactQuery from '@tanstack/react-query'\n\nimport { createBaseQuery } from './createBaseQuery'\nimport type {\n CompatibleError,\n CreateSuspenseQueryOptions,\n SuspenseQueryHook,\n} from './types'\nimport { isV5, suspenseOptions } from './utils'\n\nexport const createSuspenseQuery = <\n TFnData,\n TVariables = void,\n TError = CompatibleError\n>(\n options: CreateSuspenseQueryOptions<TFnData, TVariables, TError>\n): SuspenseQueryHook<TFnData, TVariables, TError> => {\n return isV5
|
|
1
|
+
{"version":3,"file":"createSuspenseQuery.esm.js","sources":["../../src/createSuspenseQuery.ts"],"sourcesContent":["import * as ReactQuery from '@tanstack/react-query'\n\nimport { createBaseQuery } from './createBaseQuery'\nimport type {\n CompatibleError,\n CreateSuspenseQueryOptions,\n SuspenseQueryHook,\n} from './types'\nimport { isV5, suspenseOptions } from './utils'\n\nexport const createSuspenseQuery = <\n TFnData,\n TVariables = void,\n TError = CompatibleError\n>(\n options: CreateSuspenseQueryOptions<TFnData, TVariables, TError>\n): SuspenseQueryHook<TFnData, TVariables, TError> => {\n return isV5\n ? createBaseQuery(options, ReactQuery.useSuspenseQuery)\n : createBaseQuery(options, ReactQuery.useQuery, suspenseOptions)\n}\n"],"names":["createSuspenseQuery","options","isV5","createBaseQuery","ReactQuery","useSuspenseQuery","useQuery","suspenseOptions"],"mappings":";;;;AAUaA,MAAAA,mBAAmB,GAK9BC,OALiC,IAMkB;EACnD,OAAOC,IAAI,GACPC,eAAe,CAACF,OAAD,EAAUG,UAAU,CAACC,gBAArB,CADR,GAEPF,eAAe,CAACF,OAAD,EAAUG,UAAU,CAACE,QAArB,EAA+BC,eAA/B,CAFnB,CAAA;AAGD;;;;"}
|
|
@@ -27,7 +27,7 @@ function _interopNamespace(e) {
|
|
|
27
27
|
var ReactQuery__namespace = /*#__PURE__*/_interopNamespace(ReactQuery);
|
|
28
28
|
|
|
29
29
|
const createSuspenseQuery = options => {
|
|
30
|
-
return utils.isV5
|
|
30
|
+
return utils.isV5 ? createBaseQuery.createBaseQuery(options, ReactQuery__namespace.useSuspenseQuery) : createBaseQuery.createBaseQuery(options, ReactQuery__namespace.useQuery, utils.suspenseOptions);
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
exports.createSuspenseQuery = createSuspenseQuery;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSuspenseQuery.js","sources":["../../src/createSuspenseQuery.ts"],"sourcesContent":["import * as ReactQuery from '@tanstack/react-query'\n\nimport { createBaseQuery } from './createBaseQuery'\nimport type {\n CompatibleError,\n CreateSuspenseQueryOptions,\n SuspenseQueryHook,\n} from './types'\nimport { isV5, suspenseOptions } from './utils'\n\nexport const createSuspenseQuery = <\n TFnData,\n TVariables = void,\n TError = CompatibleError\n>(\n options: CreateSuspenseQueryOptions<TFnData, TVariables, TError>\n): SuspenseQueryHook<TFnData, TVariables, TError> => {\n return isV5
|
|
1
|
+
{"version":3,"file":"createSuspenseQuery.js","sources":["../../src/createSuspenseQuery.ts"],"sourcesContent":["import * as ReactQuery from '@tanstack/react-query'\n\nimport { createBaseQuery } from './createBaseQuery'\nimport type {\n CompatibleError,\n CreateSuspenseQueryOptions,\n SuspenseQueryHook,\n} from './types'\nimport { isV5, suspenseOptions } from './utils'\n\nexport const createSuspenseQuery = <\n TFnData,\n TVariables = void,\n TError = CompatibleError\n>(\n options: CreateSuspenseQueryOptions<TFnData, TVariables, TError>\n): SuspenseQueryHook<TFnData, TVariables, TError> => {\n return isV5\n ? createBaseQuery(options, ReactQuery.useSuspenseQuery)\n : createBaseQuery(options, ReactQuery.useQuery, suspenseOptions)\n}\n"],"names":["createSuspenseQuery","options","isV5","createBaseQuery","ReactQuery","useSuspenseQuery","useQuery","suspenseOptions"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUaA,MAAAA,mBAAmB,GAK9BC,OALiC,IAMkB;EACnD,OAAOC,UAAI,GACPC,+BAAe,CAACF,OAAD,EAAUG,qBAAU,CAACC,gBAArB,CADR,GAEPF,+BAAe,CAACF,OAAD,EAAUG,qBAAU,CAACE,QAArB,EAA+BC,qBAA/B,CAFnB,CAAA;AAGD;;;;"}
|
|
@@ -3,7 +3,7 @@ import { createBaseQuery } from './createBaseQuery.mjs';
|
|
|
3
3
|
import { isV5, suspenseOptions } from './utils.mjs';
|
|
4
4
|
|
|
5
5
|
const createSuspenseQuery = options => {
|
|
6
|
-
return isV5
|
|
6
|
+
return isV5 ? createBaseQuery(options, ReactQuery.useSuspenseQuery) : createBaseQuery(options, ReactQuery.useQuery, suspenseOptions);
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
export { createSuspenseQuery };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSuspenseQuery.mjs","sources":["../../src/createSuspenseQuery.ts"],"sourcesContent":["import * as ReactQuery from '@tanstack/react-query'\n\nimport { createBaseQuery } from './createBaseQuery'\nimport type {\n CompatibleError,\n CreateSuspenseQueryOptions,\n SuspenseQueryHook,\n} from './types'\nimport { isV5, suspenseOptions } from './utils'\n\nexport const createSuspenseQuery = <\n TFnData,\n TVariables = void,\n TError = CompatibleError\n>(\n options: CreateSuspenseQueryOptions<TFnData, TVariables, TError>\n): SuspenseQueryHook<TFnData, TVariables, TError> => {\n return isV5
|
|
1
|
+
{"version":3,"file":"createSuspenseQuery.mjs","sources":["../../src/createSuspenseQuery.ts"],"sourcesContent":["import * as ReactQuery from '@tanstack/react-query'\n\nimport { createBaseQuery } from './createBaseQuery'\nimport type {\n CompatibleError,\n CreateSuspenseQueryOptions,\n SuspenseQueryHook,\n} from './types'\nimport { isV5, suspenseOptions } from './utils'\n\nexport const createSuspenseQuery = <\n TFnData,\n TVariables = void,\n TError = CompatibleError\n>(\n options: CreateSuspenseQueryOptions<TFnData, TVariables, TError>\n): SuspenseQueryHook<TFnData, TVariables, TError> => {\n return isV5\n ? createBaseQuery(options, ReactQuery.useSuspenseQuery)\n : createBaseQuery(options, ReactQuery.useQuery, suspenseOptions)\n}\n"],"names":["createSuspenseQuery","options","isV5","createBaseQuery","ReactQuery","useSuspenseQuery","useQuery","suspenseOptions"],"mappings":";;;;AAUaA,MAAAA,mBAAmB,GAK9BC,OALiC,IAMkB;EACnD,OAAOC,IAAI,GACPC,eAAe,CAACF,OAAD,EAAUG,UAAU,CAACC,gBAArB,CADR,GAEPF,eAAe,CAACF,OAAD,EAAUG,UAAU,CAACE,QAArB,EAA+BC,eAA/B,CAFnB,CAAA;AAGD;;;;"}
|
package/build/lib/types.d.ts
CHANGED
|
@@ -1,28 +1,14 @@
|
|
|
1
|
-
import type { DataTag, DefaultError, DefinedUseInfiniteQueryResult, DefinedUseQueryResult,
|
|
1
|
+
import type { DataTag, DefaultError, DefinedUseInfiniteQueryResult, DefinedUseQueryResult, InfiniteData, InfiniteQueryObserverSuccessResult, MutationFunction, MutationKey, QueryClient, QueryFunction, QueryFunctionContext, QueryKey, QueryKeyHashFunction, QueryObserverSuccessResult, UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
|
|
2
2
|
type CompatibleWithV4<V5, V4> = InfiniteData<unknown> extends UseInfiniteQueryResult<InfiniteData<unknown>>['data'] ? V5 : V4;
|
|
3
|
-
type
|
|
4
|
-
type CompatibleInfiniteQueryPageParamsOptions<TQueryFnData = unknown, TPageParam = unknown> = CompatibleWithV4<{
|
|
5
|
-
getPreviousPageParam?: GetPreviousPageParamFunction<TPageParam, TQueryFnData>;
|
|
6
|
-
getNextPageParam: GetNextPageParamFunction<TPageParam, TQueryFnData>;
|
|
7
|
-
initialPageParam: TPageParam;
|
|
8
|
-
}, {
|
|
9
|
-
getPreviousPageParam?: GetPreviousPageParamFunction<TQueryFnData>;
|
|
10
|
-
getNextPageParam: GetNextPageParamFunction<TQueryFnData>;
|
|
11
|
-
}>;
|
|
12
|
-
type CompatibleUseInfiniteQueryOptions<TFnData, TVariables, TData, TError, TPageParam> = CompatibleWithV4<UseInfiniteQueryOptions<TFnData, TError, TData, TFnData, inferQueryKey<TFnData, TVariables, TPageParam>, TPageParam>, UseInfiniteQueryOptions<TFnData, TError, TData, TFnData, inferQueryKey<TFnData, TVariables, TPageParam>>>;
|
|
3
|
+
type CompatibleUseInfiniteQueryOptions<TFnData, TData, TError, TPageParam> = CompatibleWithV4<UseInfiniteQueryOptions<TFnData, TError, TData, TFnData, QueryKey, TPageParam>, UseInfiniteQueryOptions<TFnData, TError, TData, TFnData, QueryKey>>;
|
|
13
4
|
type CompatibleInfiniteData<TFnData, TPageParam> = CompatibleWithV4<InfiniteData<TFnData, TPageParam>, InfiniteData<TFnData>>;
|
|
14
5
|
type NonUndefinedGuard<T> = T extends undefined ? never : T;
|
|
15
6
|
type WithRequired<T, K extends keyof T> = T & {
|
|
16
7
|
[_ in K]: {};
|
|
17
8
|
};
|
|
18
9
|
export type CompatibleError = CompatibleWithV4<DefaultError, Error>;
|
|
19
|
-
type GetQueryKey<TVariables> = TVariables extends void ? [string] : [string, TVariables];
|
|
20
|
-
export type inferQueryKey<TFnData, TVariables, TPageParam = never> = CompatibleWithV4<DataTag<GetQueryKey<TVariables>, [
|
|
21
|
-
TPageParam
|
|
22
|
-
] extends [never] ? TFnData : InfiniteData<TFnData, TPageParam>>, GetQueryKey<TVariables>>;
|
|
23
10
|
export type AdditionalQueryOptions<TFnData, TVariables, TPageParam = never> = {
|
|
24
|
-
|
|
25
|
-
queryFn: CompatibleQueryFunction<TFnData, inferQueryKey<TFnData, TVariables, TPageParam>, TPageParam>;
|
|
11
|
+
fetcher: (variables: TVariables, context: QueryFunctionContext<QueryKey, TPageParam>) => TFnData | Promise<TFnData>;
|
|
26
12
|
variables?: TVariables;
|
|
27
13
|
};
|
|
28
14
|
type inferMiddlewareHook<T extends (...args: any) => any> = (options: inferCreateOptions<T>, queryClient?: CompatibleWithV4<QueryClient, void>) => ReturnType<T>;
|
|
@@ -31,30 +17,29 @@ type DeepPartial<T> = T extends object ? {
|
|
|
31
17
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
32
18
|
} : T;
|
|
33
19
|
export type ExposeMethods<TFnData, TVariables, TError, TPageParam = never> = {
|
|
34
|
-
|
|
35
|
-
getKey: <V extends DeepPartial<TVariables> | void = void>(variables?: V) =>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
getFetchOptions: (variables: TVariables extends void ? TVariables | void : TVariables) =>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
queryKey:
|
|
49
|
-
|
|
50
|
-
queryKeyHashFn?: QueryKeyHashFunction<GetQueryKey<TVariables>>;
|
|
51
|
-
}> : CompatibleUseInfiniteQueryOptions<TFnData, TVariables, TFnData, TError, TPageParam>;
|
|
20
|
+
fetcher: (variables: TVariables, context?: Partial<QueryFunctionContext<QueryKey, TPageParam>>) => TFnData | Promise<TFnData>;
|
|
21
|
+
getKey: <V extends DeepPartial<TVariables> | void = void>(variables?: V) => CompatibleWithV4<DataTag<QueryKey, [
|
|
22
|
+
TPageParam
|
|
23
|
+
] extends [never] ? TFnData : InfiniteData<TFnData, TPageParam>>, QueryKey>;
|
|
24
|
+
getFetchOptions: (variables: TVariables extends void ? TVariables | void : TVariables) => Pick<ReturnType<ExposeMethods<TFnData, TVariables, TError, TPageParam>['getOptions']>, [
|
|
25
|
+
TPageParam
|
|
26
|
+
] extends [never] ? 'queryKey' | 'queryFn' | 'queryKeyHashFn' : 'queryKey' | 'queryFn' | 'queryKeyHashFn' | 'getNextPageParam' | 'getPreviousPageParam' | 'initialPageParam'>;
|
|
27
|
+
getOptions: (variables: TVariables extends void ? TVariables | void : TVariables) => [TPageParam] extends [never] ? CompatibleWithV4<UseQueryOptions<TFnData, TError, TFnData, QueryKey> & {
|
|
28
|
+
queryKey: DataTag<QueryKey, TFnData>;
|
|
29
|
+
}, {
|
|
30
|
+
queryKey: QueryKey;
|
|
31
|
+
queryFn: QueryFunction<TFnData, QueryKey>;
|
|
32
|
+
queryKeyHashFn?: QueryKeyHashFunction<QueryKey>;
|
|
33
|
+
}> : CompatibleUseInfiniteQueryOptions<TFnData, TFnData, TError, TPageParam> & {
|
|
34
|
+
queryKey: CompatibleWithV4<DataTag<QueryKey, InfiniteData<TFnData, TPageParam>>, QueryKey>;
|
|
35
|
+
};
|
|
52
36
|
};
|
|
53
|
-
|
|
54
|
-
|
|
37
|
+
type Clone<T> = T extends infer TClone ? TClone : never;
|
|
38
|
+
export interface CreateQueryOptions<TFnData = unknown, TVariables = void, TError = CompatibleError> extends Omit<UseQueryOptions<TFnData, TError, TFnData, QueryKey>, 'queryFn' | 'select'>, AdditionalQueryOptions<TFnData, TVariables> {
|
|
39
|
+
use?: Middleware<QueryHook<Clone<TFnData>, Clone<TVariables>, Clone<TError>>>[];
|
|
55
40
|
variables?: TVariables;
|
|
56
41
|
}
|
|
57
|
-
export interface QueryHookOptions<TFnData, TError, TData, TVariables> extends Omit<UseQueryOptions<TFnData, TError, TData,
|
|
42
|
+
export interface QueryHookOptions<TFnData, TError, TData, TVariables> extends Omit<UseQueryOptions<TFnData, TError, TData, QueryKey>, 'queryKey' | 'queryFn' | 'queryKeyHashFn'> {
|
|
58
43
|
use?: Middleware<QueryHook<TFnData, TVariables, TError>>[];
|
|
59
44
|
variables?: TVariables;
|
|
60
45
|
}
|
|
@@ -67,10 +52,10 @@ export interface QueryHook<TFnData = unknown, TVariables = any, TError = Compati
|
|
|
67
52
|
<TData = TFnData>(options: DefinedQueryHookOptions<TFnData, TError, TData, TVariables>, queryClient?: CompatibleWithV4<QueryClient, void>): DefinedQueryHookResult<TData, TError>;
|
|
68
53
|
<TData = TFnData>(options?: QueryHookOptions<TFnData, TError, TData, TVariables>, queryClient?: CompatibleWithV4<QueryClient, void>): QueryHookResult<TData, TError>;
|
|
69
54
|
}
|
|
70
|
-
export interface CreateSuspenseQueryOptions<TFnData = unknown, TVariables = void, TError = CompatibleError> extends Omit<UseQueryOptions<TFnData, TError, TFnData,
|
|
71
|
-
use?: Middleware<SuspenseQueryHook<TFnData
|
|
55
|
+
export interface CreateSuspenseQueryOptions<TFnData = unknown, TVariables = void, TError = CompatibleError> extends Omit<UseQueryOptions<TFnData, TError, TFnData, QueryKey>, 'queryFn' | 'enabled' | 'select' | 'suspense' | 'throwOnError' | 'placeholderData' | 'keepPreviousData' | 'useErrorBoundary'>, AdditionalQueryOptions<TFnData, TVariables> {
|
|
56
|
+
use?: Middleware<SuspenseQueryHook<Clone<TFnData>, Clone<TVariables>, Clone<TError>>>[];
|
|
72
57
|
}
|
|
73
|
-
export interface SuspenseQueryHookOptions<TFnData, TError, TData, TVariables> extends Omit<UseQueryOptions<TFnData, TError, TData,
|
|
58
|
+
export interface SuspenseQueryHookOptions<TFnData, TError, TData, TVariables> extends Omit<UseQueryOptions<TFnData, TError, TData, QueryKey>, 'queryKey' | 'queryFn' | 'queryKeyHashFn' | 'enabled' | 'suspense' | 'throwOnError' | 'placeholderData' | 'keepPreviousData' | 'useErrorBoundary'> {
|
|
74
59
|
use?: Middleware<SuspenseQueryHook<TFnData, TVariables, TVariables>>[];
|
|
75
60
|
variables?: TVariables;
|
|
76
61
|
}
|
|
@@ -78,10 +63,10 @@ export type SuspenseQueryHookResult<TData, TError> = Omit<QueryObserverSuccessRe
|
|
|
78
63
|
export interface SuspenseQueryHook<TFnData = unknown, TVariables = void, TError = CompatibleError> extends ExposeMethods<TFnData, TVariables, TError> {
|
|
79
64
|
<TData = TFnData>(options?: SuspenseQueryHookOptions<TFnData, TError, TData, TVariables>, queryClient?: CompatibleWithV4<QueryClient, void>): SuspenseQueryHookResult<TData, TError>;
|
|
80
65
|
}
|
|
81
|
-
export interface CreateInfiniteQueryOptions<TFnData = unknown, TVariables = void, TError = CompatibleError, TPageParam = number> extends Omit<CompatibleUseInfiniteQueryOptions<TFnData,
|
|
82
|
-
use?: Middleware<InfiniteQueryHook<TFnData
|
|
66
|
+
export interface CreateInfiniteQueryOptions<TFnData = unknown, TVariables = void, TError = CompatibleError, TPageParam = number> extends Omit<CompatibleUseInfiniteQueryOptions<TFnData, TFnData, TError, TPageParam>, 'queryFn' | 'select'>, AdditionalQueryOptions<TFnData, TVariables, TPageParam> {
|
|
67
|
+
use?: Middleware<InfiniteQueryHook<Clone<TFnData>, Clone<TVariables>, Clone<TError>, Clone<TPageParam>>>[];
|
|
83
68
|
}
|
|
84
|
-
export interface InfiniteQueryHookOptions<TFnData, TError, TData, TVariables, TPageParam = number> extends Omit<CompatibleUseInfiniteQueryOptions<TFnData,
|
|
69
|
+
export interface InfiniteQueryHookOptions<TFnData, TError, TData, TVariables, TPageParam = number> extends Omit<CompatibleUseInfiniteQueryOptions<TFnData, TData, TError, TPageParam>, 'queryKey' | 'queryFn' | 'queryKeyHashFn' | 'initialPageParam' | 'getPreviousPageParam' | 'getNextPageParam'> {
|
|
85
70
|
use?: Middleware<InfiniteQueryHook<TFnData, TVariables, TError, TPageParam>>[];
|
|
86
71
|
variables?: TVariables;
|
|
87
72
|
}
|
|
@@ -94,10 +79,10 @@ export interface InfiniteQueryHook<TFnData = unknown, TVariables = void, TError
|
|
|
94
79
|
<TData = CompatibleWithV4<InfiniteData<TFnData, TPageParam>, TFnData>>(options: DefinedInfiniteQueryHookOptions<TFnData, TError, TData, TVariables, TPageParam>, queryClient?: CompatibleWithV4<QueryClient, void>): DefinedInfiniteQueryHookResult<TData, TError>;
|
|
95
80
|
<TData = CompatibleWithV4<InfiniteData<TFnData, TPageParam>, TFnData>>(options?: InfiniteQueryHookOptions<TFnData, TError, TData, TVariables, TPageParam>, queryClient?: CompatibleWithV4<QueryClient, void>): InfiniteQueryHookResult<TData, TError>;
|
|
96
81
|
}
|
|
97
|
-
export interface CreateSuspenseInfiniteQueryOptions<TFnData = unknown, TVariables = void, TError = CompatibleError, TPageParam = number> extends Omit<CompatibleUseInfiniteQueryOptions<TFnData,
|
|
98
|
-
use?: Middleware<SuspenseInfiniteQueryHook<TFnData
|
|
82
|
+
export interface CreateSuspenseInfiniteQueryOptions<TFnData = unknown, TVariables = void, TError = CompatibleError, TPageParam = number> extends Omit<CompatibleUseInfiniteQueryOptions<TFnData, TFnData, TError, TPageParam>, 'queryFn' | 'enabled' | 'select' | 'suspense' | 'throwOnError' | 'placeholderData' | 'keepPreviousData' | 'useErrorBoundary'>, AdditionalQueryOptions<TFnData, TVariables, TPageParam> {
|
|
83
|
+
use?: Middleware<SuspenseInfiniteQueryHook<Clone<TFnData>, Clone<TVariables>, Clone<TError>, Clone<TPageParam>>>[];
|
|
99
84
|
}
|
|
100
|
-
export interface SuspenseInfiniteQueryHookOptions<TFnData, TError, TData, TVariables, TPageParam = number> extends Omit<CompatibleUseInfiniteQueryOptions<TFnData,
|
|
85
|
+
export interface SuspenseInfiniteQueryHookOptions<TFnData, TError, TData, TVariables, TPageParam = number> extends Omit<CompatibleUseInfiniteQueryOptions<TFnData, TData, TError, TPageParam>, 'queryKey' | 'queryFn' | 'queryKeyHashFn' | 'enabled' | 'initialPageParam' | 'getPreviousPageParam' | 'getNextPageParam' | 'suspense' | 'throwOnError' | 'placeholderData' | 'keepPreviousData' | 'useErrorBoundary'> {
|
|
101
86
|
use?: Middleware<SuspenseInfiniteQueryHook<TFnData, TVariables, TVariables>>[];
|
|
102
87
|
variables?: TVariables;
|
|
103
88
|
}
|
|
@@ -110,12 +95,12 @@ export interface CreateMutationOptions<TData = unknown, TVariables = void, TErro
|
|
|
110
95
|
}
|
|
111
96
|
export interface MutationHookOptions<TData, TError, TVariables, TContext> extends Omit<UseMutationOptions<TData, TError, TVariables, TContext>, 'mutationFn' | 'mutationKey'> {
|
|
112
97
|
use?: Middleware<MutationHook<TData, TError, TVariables>>[];
|
|
113
|
-
variables?: TVariables;
|
|
114
98
|
}
|
|
115
99
|
export type MutationHookResult<TData = unknown, TError = CompatibleError, TVariables = void, TContext = unknown> = UseMutationResult<TData, TError, TVariables, TContext>;
|
|
116
|
-
export interface MutationHook<TData = unknown, TVariables = void, TError = unknown> {
|
|
117
|
-
<TContext>(options?: MutationHookOptions<TData, TError, TVariables, TContext>, queryClient?: CompatibleWithV4<QueryClient, void>): MutationHookResult<TData, TError, TVariables, TContext>;
|
|
100
|
+
export interface MutationHook<TData = unknown, TVariables = void, TError = unknown, TDefaultContext = unknown> {
|
|
101
|
+
<TContext = TDefaultContext>(options?: MutationHookOptions<TData, TError, TVariables, TContext>, queryClient?: CompatibleWithV4<QueryClient, void>): MutationHookResult<TData, TError, TVariables, TContext>;
|
|
118
102
|
getKey: () => MutationKey | undefined;
|
|
103
|
+
getOptions: () => UseMutationOptions<TData, TError, TVariables, TDefaultContext>;
|
|
119
104
|
mutationFn: MutationFunction<TData, TVariables>;
|
|
120
105
|
}
|
|
121
106
|
export type inferVariables<T> = T extends QueryHook<any, infer TVariables, any> ? TVariables : T extends SuspenseQueryHook<any, infer TVariables, any> ? TVariables : T extends InfiniteQueryHook<any, infer TVariables, any> ? TVariables : T extends SuspenseInfiniteQueryHook<any, infer TVariables, any> ? TVariables : T extends MutationHook<any, infer TVariables, any> ? TVariables : never;
|
package/build/lib/utils.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import * as ReactQuery from '@tanstack/react-query';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
use?: Middleware[];
|
|
6
|
-
}, queryClient?: ReactQuery.QueryClient) => any;
|
|
2
|
+
import type { Query, QueryClient } from '@tanstack/react-query';
|
|
3
|
+
import type { Middleware } from './types';
|
|
4
|
+
export declare const isV5 = true;
|
|
7
5
|
export declare const suspenseOptions: {
|
|
8
6
|
enabled: boolean;
|
|
9
7
|
suspense: boolean;
|
|
10
|
-
useErrorBoundary: (_error: unknown, query:
|
|
8
|
+
useErrorBoundary: (_error: unknown, query: Query) => boolean;
|
|
11
9
|
};
|
|
12
|
-
export declare const
|
|
13
|
-
|
|
10
|
+
export declare const withMiddleware: (hook: any, defaultOptions: any, type: 'queries' | 'mutations') => (options?: {
|
|
11
|
+
client?: QueryClient;
|
|
12
|
+
use?: Middleware[];
|
|
13
|
+
}, queryClient?: QueryClient) => any;
|
|
14
|
+
export declare const getKey: (queryKey: ReactQuery.QueryKey, variables?: any) => ReactQuery.QueryKey;
|
package/build/lib/utils.esm.js
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import * as ReactQuery from '@tanstack/react-query';
|
|
2
2
|
|
|
3
|
+
const isV5 = !!ReactQuery.useSuspenseQuery; // Compatible with ReactQuery v4
|
|
4
|
+
|
|
5
|
+
const suspenseOptions = {
|
|
6
|
+
enabled: true,
|
|
7
|
+
suspense: true,
|
|
8
|
+
useErrorBoundary: (_error, query) => query.state.data === undefined
|
|
9
|
+
};
|
|
3
10
|
const withMiddleware = (hook, defaultOptions, type) => {
|
|
4
11
|
return function useMiddleware(options, queryClient) {
|
|
5
12
|
const [middleware, opts] = [ReactQuery.useQueryClient( // @ts-ignore Compatible with ReactQuery v4
|
|
6
|
-
isV5
|
|
13
|
+
isV5 ? queryClient : options).getDefaultOptions()[type], defaultOptions, options].reduce(([u1, o1], {
|
|
7
14
|
use: u2 = [],
|
|
8
15
|
...o2
|
|
9
16
|
} = {}) => [[...u1, ...u2], { ...o1,
|
|
@@ -17,16 +24,9 @@ const withMiddleware = (hook, defaultOptions, type) => {
|
|
|
17
24
|
|
|
18
25
|
return next(opts, queryClient);
|
|
19
26
|
};
|
|
20
|
-
}; // Compatible with ReactQuery v4
|
|
21
|
-
|
|
22
|
-
const suspenseOptions = {
|
|
23
|
-
enabled: true,
|
|
24
|
-
suspense: true,
|
|
25
|
-
useErrorBoundary: (_error, query) => query.state.data === undefined
|
|
26
27
|
};
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
return variables === undefined ? [primaryKey] : [primaryKey, variables];
|
|
28
|
+
const getKey = (queryKey, variables) => {
|
|
29
|
+
return variables === undefined ? [...queryKey] : [...queryKey, variables];
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
export { getKey, isV5, suspenseOptions, withMiddleware };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.esm.js","sources":["../../src/utils.ts"],"sourcesContent":["import * as ReactQuery from '@tanstack/react-query'\n\nimport type { Middleware
|
|
1
|
+
{"version":3,"file":"utils.esm.js","sources":["../../src/utils.ts"],"sourcesContent":["import * as ReactQuery from '@tanstack/react-query'\nimport type { Query, QueryClient, QueryKey } from '@tanstack/react-query'\n\nimport type { Middleware } from './types'\n\nexport const isV5 = !!ReactQuery.useSuspenseQuery\n\n// Compatible with ReactQuery v4\nexport const suspenseOptions = {\n enabled: true,\n suspense: true,\n useErrorBoundary: (_error: unknown, query: Query) =>\n query.state.data === undefined,\n}\n\nexport const withMiddleware = (\n hook: any,\n defaultOptions: any,\n type: 'queries' | 'mutations'\n) => {\n return function useMiddleware(\n options?: { client?: QueryClient; use?: Middleware[] },\n queryClient?: QueryClient\n ) {\n const [middleware, opts] = [\n ReactQuery.useQueryClient(\n // @ts-ignore Compatible with ReactQuery v4\n isV5 ? queryClient : options\n ).getDefaultOptions()[type],\n defaultOptions,\n options,\n ].reduce(\n ([u1, o1], { use: u2 = [], ...o2 } = {}) => [\n [...u1, ...u2],\n { ...o1, ...o2 },\n ],\n [[]]\n )\n\n let next = hook\n for (let i = middleware.length; i--; ) {\n next = middleware[i](next)\n }\n\n return next(opts, queryClient)\n }\n}\n\nexport const getKey = (queryKey: QueryKey, variables?: any): QueryKey => {\n return variables === undefined ? [...queryKey] : [...queryKey, variables]\n}\n"],"names":["isV5","ReactQuery","useSuspenseQuery","suspenseOptions","enabled","suspense","useErrorBoundary","_error","query","state","data","undefined","withMiddleware","hook","defaultOptions","type","useMiddleware","options","queryClient","middleware","opts","useQueryClient","getDefaultOptions","reduce","u1","o1","use","u2","o2","next","i","length","getKey","queryKey","variables"],"mappings":";;AAKO,MAAMA,IAAI,GAAG,CAAC,CAACC,UAAU,CAACC;;AAG1B,MAAMC,eAAe,GAAG;AAC7BC,EAAAA,OAAO,EAAE,IADoB;AAE7BC,EAAAA,QAAQ,EAAE,IAFmB;EAG7BC,gBAAgB,EAAE,CAACC,MAAD,EAAkBC,KAAlB,KAChBA,KAAK,CAACC,KAAN,CAAYC,IAAZ,KAAqBC,SAAAA;AAJM,EAAxB;AAOA,MAAMC,cAAc,GAAG,CAC5BC,IAD4B,EAE5BC,cAF4B,EAG5BC,IAH4B,KAIzB;AACH,EAAA,OAAO,SAASC,aAAT,CACLC,OADK,EAELC,WAFK,EAGL;IACA,MAAM,CAACC,UAAD,EAAaC,IAAb,IAAqB,CACzBnB,UAAU,CAACoB,cAAX;IAEErB,IAAI,GAAGkB,WAAH,GAAiBD,OAFvB,EAGEK,iBAHF,EAAA,CAGsBP,IAHtB,CADyB,EAKzBD,cALyB,EAMzBG,OANyB,CAAA,CAOzBM,MAPyB,CAQzB,CAAC,CAACC,EAAD,EAAKC,EAAL,CAAD,EAAW;MAAEC,GAAG,EAAEC,EAAE,GAAG,EAAZ;MAAgB,GAAGC,EAAAA;AAAnB,KAAA,GAA0B,EAArC,KAA4C,CAC1C,CAAC,GAAGJ,EAAJ,EAAQ,GAAGG,EAAX,CAD0C,EAE1C,EAAE,GAAGF,EAAL;MAAS,GAAGG,EAAAA;AAAZ,KAF0C,CARnB,EAYzB,CAAC,EAAD,CAZyB,CAA3B,CAAA;IAeA,IAAIC,IAAI,GAAGhB,IAAX,CAAA;;IACA,KAAK,IAAIiB,CAAC,GAAGX,UAAU,CAACY,MAAxB,EAAgCD,CAAC,EAAjC,GAAuC;AACrCD,MAAAA,IAAI,GAAGV,UAAU,CAACW,CAAD,CAAV,CAAcD,IAAd,CAAP,CAAA;AACD,KAAA;;AAED,IAAA,OAAOA,IAAI,CAACT,IAAD,EAAOF,WAAP,CAAX,CAAA;GAxBF,CAAA;AA0BD,EA/BM;MAiCMc,MAAM,GAAG,CAACC,QAAD,EAAqBC,SAArB,KAAmD;AACvE,EAAA,OAAOA,SAAS,KAAKvB,SAAd,GAA0B,CAAC,GAAGsB,QAAJ,CAA1B,GAA0C,CAAC,GAAGA,QAAJ,EAAcC,SAAd,CAAjD,CAAA;AACD;;;;"}
|
package/build/lib/utils.js
CHANGED
|
@@ -24,10 +24,17 @@ function _interopNamespace(e) {
|
|
|
24
24
|
|
|
25
25
|
var ReactQuery__namespace = /*#__PURE__*/_interopNamespace(ReactQuery);
|
|
26
26
|
|
|
27
|
+
const isV5 = !!ReactQuery__namespace.useSuspenseQuery; // Compatible with ReactQuery v4
|
|
28
|
+
|
|
29
|
+
const suspenseOptions = {
|
|
30
|
+
enabled: true,
|
|
31
|
+
suspense: true,
|
|
32
|
+
useErrorBoundary: (_error, query) => query.state.data === undefined
|
|
33
|
+
};
|
|
27
34
|
const withMiddleware = (hook, defaultOptions, type) => {
|
|
28
35
|
return function useMiddleware(options, queryClient) {
|
|
29
36
|
const [middleware, opts] = [ReactQuery__namespace.useQueryClient( // @ts-ignore Compatible with ReactQuery v4
|
|
30
|
-
isV5
|
|
37
|
+
isV5 ? queryClient : options).getDefaultOptions()[type], defaultOptions, options].reduce(([u1, o1], {
|
|
31
38
|
use: u2 = [],
|
|
32
39
|
...o2
|
|
33
40
|
} = {}) => [[...u1, ...u2], { ...o1,
|
|
@@ -41,16 +48,9 @@ const withMiddleware = (hook, defaultOptions, type) => {
|
|
|
41
48
|
|
|
42
49
|
return next(opts, queryClient);
|
|
43
50
|
};
|
|
44
|
-
}; // Compatible with ReactQuery v4
|
|
45
|
-
|
|
46
|
-
const suspenseOptions = {
|
|
47
|
-
enabled: true,
|
|
48
|
-
suspense: true,
|
|
49
|
-
useErrorBoundary: (_error, query) => query.state.data === undefined
|
|
50
51
|
};
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
return variables === undefined ? [primaryKey] : [primaryKey, variables];
|
|
52
|
+
const getKey = (queryKey, variables) => {
|
|
53
|
+
return variables === undefined ? [...queryKey] : [...queryKey, variables];
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
exports.getKey = getKey;
|
package/build/lib/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../src/utils.ts"],"sourcesContent":["import * as ReactQuery from '@tanstack/react-query'\n\nimport type { Middleware
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../src/utils.ts"],"sourcesContent":["import * as ReactQuery from '@tanstack/react-query'\nimport type { Query, QueryClient, QueryKey } from '@tanstack/react-query'\n\nimport type { Middleware } from './types'\n\nexport const isV5 = !!ReactQuery.useSuspenseQuery\n\n// Compatible with ReactQuery v4\nexport const suspenseOptions = {\n enabled: true,\n suspense: true,\n useErrorBoundary: (_error: unknown, query: Query) =>\n query.state.data === undefined,\n}\n\nexport const withMiddleware = (\n hook: any,\n defaultOptions: any,\n type: 'queries' | 'mutations'\n) => {\n return function useMiddleware(\n options?: { client?: QueryClient; use?: Middleware[] },\n queryClient?: QueryClient\n ) {\n const [middleware, opts] = [\n ReactQuery.useQueryClient(\n // @ts-ignore Compatible with ReactQuery v4\n isV5 ? queryClient : options\n ).getDefaultOptions()[type],\n defaultOptions,\n options,\n ].reduce(\n ([u1, o1], { use: u2 = [], ...o2 } = {}) => [\n [...u1, ...u2],\n { ...o1, ...o2 },\n ],\n [[]]\n )\n\n let next = hook\n for (let i = middleware.length; i--; ) {\n next = middleware[i](next)\n }\n\n return next(opts, queryClient)\n }\n}\n\nexport const getKey = (queryKey: QueryKey, variables?: any): QueryKey => {\n return variables === undefined ? [...queryKey] : [...queryKey, variables]\n}\n"],"names":["isV5","ReactQuery","useSuspenseQuery","suspenseOptions","enabled","suspense","useErrorBoundary","_error","query","state","data","undefined","withMiddleware","hook","defaultOptions","type","useMiddleware","options","queryClient","middleware","opts","useQueryClient","getDefaultOptions","reduce","u1","o1","use","u2","o2","next","i","length","getKey","queryKey","variables"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKO,MAAMA,IAAI,GAAG,CAAC,CAACC,qBAAU,CAACC;;AAG1B,MAAMC,eAAe,GAAG;AAC7BC,EAAAA,OAAO,EAAE,IADoB;AAE7BC,EAAAA,QAAQ,EAAE,IAFmB;EAG7BC,gBAAgB,EAAE,CAACC,MAAD,EAAkBC,KAAlB,KAChBA,KAAK,CAACC,KAAN,CAAYC,IAAZ,KAAqBC,SAAAA;AAJM,EAAxB;AAOA,MAAMC,cAAc,GAAG,CAC5BC,IAD4B,EAE5BC,cAF4B,EAG5BC,IAH4B,KAIzB;AACH,EAAA,OAAO,SAASC,aAAT,CACLC,OADK,EAELC,WAFK,EAGL;IACA,MAAM,CAACC,UAAD,EAAaC,IAAb,IAAqB,CACzBnB,qBAAU,CAACoB,cAAX;IAEErB,IAAI,GAAGkB,WAAH,GAAiBD,OAFvB,EAGEK,iBAHF,EAAA,CAGsBP,IAHtB,CADyB,EAKzBD,cALyB,EAMzBG,OANyB,CAAA,CAOzBM,MAPyB,CAQzB,CAAC,CAACC,EAAD,EAAKC,EAAL,CAAD,EAAW;MAAEC,GAAG,EAAEC,EAAE,GAAG,EAAZ;MAAgB,GAAGC,EAAAA;AAAnB,KAAA,GAA0B,EAArC,KAA4C,CAC1C,CAAC,GAAGJ,EAAJ,EAAQ,GAAGG,EAAX,CAD0C,EAE1C,EAAE,GAAGF,EAAL;MAAS,GAAGG,EAAAA;AAAZ,KAF0C,CARnB,EAYzB,CAAC,EAAD,CAZyB,CAA3B,CAAA;IAeA,IAAIC,IAAI,GAAGhB,IAAX,CAAA;;IACA,KAAK,IAAIiB,CAAC,GAAGX,UAAU,CAACY,MAAxB,EAAgCD,CAAC,EAAjC,GAAuC;AACrCD,MAAAA,IAAI,GAAGV,UAAU,CAACW,CAAD,CAAV,CAAcD,IAAd,CAAP,CAAA;AACD,KAAA;;AAED,IAAA,OAAOA,IAAI,CAACT,IAAD,EAAOF,WAAP,CAAX,CAAA;GAxBF,CAAA;AA0BD,EA/BM;MAiCMc,MAAM,GAAG,CAACC,QAAD,EAAqBC,SAArB,KAAmD;AACvE,EAAA,OAAOA,SAAS,KAAKvB,SAAd,GAA0B,CAAC,GAAGsB,QAAJ,CAA1B,GAA0C,CAAC,GAAGA,QAAJ,EAAcC,SAAd,CAAjD,CAAA;AACD;;;;;;;"}
|
package/build/lib/utils.mjs
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import * as ReactQuery from '@tanstack/react-query';
|
|
2
2
|
|
|
3
|
+
const isV5 = !!ReactQuery.useSuspenseQuery; // Compatible with ReactQuery v4
|
|
4
|
+
|
|
5
|
+
const suspenseOptions = {
|
|
6
|
+
enabled: true,
|
|
7
|
+
suspense: true,
|
|
8
|
+
useErrorBoundary: (_error, query) => query.state.data === undefined
|
|
9
|
+
};
|
|
3
10
|
const withMiddleware = (hook, defaultOptions, type) => {
|
|
4
11
|
return function useMiddleware(options, queryClient) {
|
|
5
12
|
const [middleware, opts] = [ReactQuery.useQueryClient( // @ts-ignore Compatible with ReactQuery v4
|
|
6
|
-
isV5
|
|
13
|
+
isV5 ? queryClient : options).getDefaultOptions()[type], defaultOptions, options].reduce(([u1, o1], {
|
|
7
14
|
use: u2 = [],
|
|
8
15
|
...o2
|
|
9
16
|
} = {}) => [[...u1, ...u2], { ...o1,
|
|
@@ -17,16 +24,9 @@ const withMiddleware = (hook, defaultOptions, type) => {
|
|
|
17
24
|
|
|
18
25
|
return next(opts, queryClient);
|
|
19
26
|
};
|
|
20
|
-
}; // Compatible with ReactQuery v4
|
|
21
|
-
|
|
22
|
-
const suspenseOptions = {
|
|
23
|
-
enabled: true,
|
|
24
|
-
suspense: true,
|
|
25
|
-
useErrorBoundary: (_error, query) => query.state.data === undefined
|
|
26
27
|
};
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
return variables === undefined ? [primaryKey] : [primaryKey, variables];
|
|
28
|
+
const getKey = (queryKey, variables) => {
|
|
29
|
+
return variables === undefined ? [...queryKey] : [...queryKey, variables];
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
export { getKey, isV5, suspenseOptions, withMiddleware };
|
package/build/lib/utils.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.mjs","sources":["../../src/utils.ts"],"sourcesContent":["import * as ReactQuery from '@tanstack/react-query'\n\nimport type { Middleware
|
|
1
|
+
{"version":3,"file":"utils.mjs","sources":["../../src/utils.ts"],"sourcesContent":["import * as ReactQuery from '@tanstack/react-query'\nimport type { Query, QueryClient, QueryKey } from '@tanstack/react-query'\n\nimport type { Middleware } from './types'\n\nexport const isV5 = !!ReactQuery.useSuspenseQuery\n\n// Compatible with ReactQuery v4\nexport const suspenseOptions = {\n enabled: true,\n suspense: true,\n useErrorBoundary: (_error: unknown, query: Query) =>\n query.state.data === undefined,\n}\n\nexport const withMiddleware = (\n hook: any,\n defaultOptions: any,\n type: 'queries' | 'mutations'\n) => {\n return function useMiddleware(\n options?: { client?: QueryClient; use?: Middleware[] },\n queryClient?: QueryClient\n ) {\n const [middleware, opts] = [\n ReactQuery.useQueryClient(\n // @ts-ignore Compatible with ReactQuery v4\n isV5 ? queryClient : options\n ).getDefaultOptions()[type],\n defaultOptions,\n options,\n ].reduce(\n ([u1, o1], { use: u2 = [], ...o2 } = {}) => [\n [...u1, ...u2],\n { ...o1, ...o2 },\n ],\n [[]]\n )\n\n let next = hook\n for (let i = middleware.length; i--; ) {\n next = middleware[i](next)\n }\n\n return next(opts, queryClient)\n }\n}\n\nexport const getKey = (queryKey: QueryKey, variables?: any): QueryKey => {\n return variables === undefined ? [...queryKey] : [...queryKey, variables]\n}\n"],"names":["isV5","ReactQuery","useSuspenseQuery","suspenseOptions","enabled","suspense","useErrorBoundary","_error","query","state","data","undefined","withMiddleware","hook","defaultOptions","type","useMiddleware","options","queryClient","middleware","opts","useQueryClient","getDefaultOptions","reduce","u1","o1","use","u2","o2","next","i","length","getKey","queryKey","variables"],"mappings":";;AAKO,MAAMA,IAAI,GAAG,CAAC,CAACC,UAAU,CAACC;;AAG1B,MAAMC,eAAe,GAAG;AAC7BC,EAAAA,OAAO,EAAE,IADoB;AAE7BC,EAAAA,QAAQ,EAAE,IAFmB;EAG7BC,gBAAgB,EAAE,CAACC,MAAD,EAAkBC,KAAlB,KAChBA,KAAK,CAACC,KAAN,CAAYC,IAAZ,KAAqBC,SAAAA;AAJM,EAAxB;AAOA,MAAMC,cAAc,GAAG,CAC5BC,IAD4B,EAE5BC,cAF4B,EAG5BC,IAH4B,KAIzB;AACH,EAAA,OAAO,SAASC,aAAT,CACLC,OADK,EAELC,WAFK,EAGL;IACA,MAAM,CAACC,UAAD,EAAaC,IAAb,IAAqB,CACzBnB,UAAU,CAACoB,cAAX;IAEErB,IAAI,GAAGkB,WAAH,GAAiBD,OAFvB,EAGEK,iBAHF,EAAA,CAGsBP,IAHtB,CADyB,EAKzBD,cALyB,EAMzBG,OANyB,CAAA,CAOzBM,MAPyB,CAQzB,CAAC,CAACC,EAAD,EAAKC,EAAL,CAAD,EAAW;MAAEC,GAAG,EAAEC,EAAE,GAAG,EAAZ;MAAgB,GAAGC,EAAAA;AAAnB,KAAA,GAA0B,EAArC,KAA4C,CAC1C,CAAC,GAAGJ,EAAJ,EAAQ,GAAGG,EAAX,CAD0C,EAE1C,EAAE,GAAGF,EAAL;MAAS,GAAGG,EAAAA;AAAZ,KAF0C,CARnB,EAYzB,CAAC,EAAD,CAZyB,CAA3B,CAAA;IAeA,IAAIC,IAAI,GAAGhB,IAAX,CAAA;;IACA,KAAK,IAAIiB,CAAC,GAAGX,UAAU,CAACY,MAAxB,EAAgCD,CAAC,EAAjC,GAAuC;AACrCD,MAAAA,IAAI,GAAGV,UAAU,CAACW,CAAD,CAAV,CAAcD,IAAd,CAAP,CAAA;AACD,KAAA;;AAED,IAAA,OAAOA,IAAI,CAACT,IAAD,EAAOF,WAAP,CAAX,CAAA;GAxBF,CAAA;AA0BD,EA/BM;MAiCMc,MAAM,GAAG,CAACC,QAAD,EAAqBC,SAArB,KAAmD;AACvE,EAAA,OAAOA,SAAS,KAAKvB,SAAd,GAA0B,CAAC,GAAGsB,QAAJ,CAA1B,GAA0C,CAAC,GAAGA,QAAJ,EAAcC,SAAd,CAAjD,CAAA;AACD;;;;"}
|
package/build/stats-html.html
CHANGED
|
@@ -4014,7 +4014,7 @@ var drawChart = (function (exports) {
|
|
|
4014
4014
|
</script>
|
|
4015
4015
|
<script>
|
|
4016
4016
|
/*<!--*/
|
|
4017
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"zip.esm.js","children":[{"name":"src","children":[{"uid":"
|
|
4017
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"zip.esm.js","children":[{"name":"src","children":[{"uid":"c574-1","name":"utils.ts"},{"uid":"c574-3","name":"createBaseQuery.ts"},{"uid":"c574-5","name":"createQuery.ts"},{"uid":"c574-7","name":"createSuspenseQuery.ts"},{"uid":"c574-9","name":"createInfiniteQuery.ts"},{"uid":"c574-11","name":"createSuspenseInfiniteQuery.ts"},{"uid":"c574-13","name":"createMutation.ts"},{"uid":"c574-15","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"c574-1":{"renderedLength":906,"gzipLength":453,"brotliLength":0,"mainUid":"c574-0"},"c574-3":{"renderedLength":1162,"gzipLength":397,"brotliLength":0,"mainUid":"c574-2"},"c574-5":{"renderedLength":91,"gzipLength":87,"brotliLength":0,"mainUid":"c574-4"},"c574-7":{"renderedLength":179,"gzipLength":118,"brotliLength":0,"mainUid":"c574-6"},"c574-9":{"renderedLength":107,"gzipLength":97,"brotliLength":0,"mainUid":"c574-8"},"c574-11":{"renderedLength":203,"gzipLength":128,"brotliLength":0,"mainUid":"c574-10"},"c574-13":{"renderedLength":271,"gzipLength":168,"brotliLength":0,"mainUid":"c574-12"},"c574-15":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"c574-14"}},"nodeMetas":{"c574-0":{"id":"/src/utils.ts","moduleParts":{"zip.esm.js":"c574-1"},"imported":[{"uid":"c574-17"}],"importedBy":[{"uid":"c574-14"},{"uid":"c574-6"},{"uid":"c574-10"},{"uid":"c574-12"},{"uid":"c574-2"}]},"c574-2":{"id":"/src/createBaseQuery.ts","moduleParts":{"zip.esm.js":"c574-3"},"imported":[{"uid":"c574-0"}],"importedBy":[{"uid":"c574-4"},{"uid":"c574-6"},{"uid":"c574-8"},{"uid":"c574-10"}]},"c574-4":{"id":"/src/createQuery.ts","moduleParts":{"zip.esm.js":"c574-5"},"imported":[{"uid":"c574-17"},{"uid":"c574-2"}],"importedBy":[{"uid":"c574-14"}]},"c574-6":{"id":"/src/createSuspenseQuery.ts","moduleParts":{"zip.esm.js":"c574-7"},"imported":[{"uid":"c574-17"},{"uid":"c574-2"},{"uid":"c574-0"}],"importedBy":[{"uid":"c574-14"}]},"c574-8":{"id":"/src/createInfiniteQuery.ts","moduleParts":{"zip.esm.js":"c574-9"},"imported":[{"uid":"c574-17"},{"uid":"c574-2"}],"importedBy":[{"uid":"c574-14"}]},"c574-10":{"id":"/src/createSuspenseInfiniteQuery.ts","moduleParts":{"zip.esm.js":"c574-11"},"imported":[{"uid":"c574-17"},{"uid":"c574-2"},{"uid":"c574-0"}],"importedBy":[{"uid":"c574-14"}]},"c574-12":{"id":"/src/createMutation.ts","moduleParts":{"zip.esm.js":"c574-13"},"imported":[{"uid":"c574-17"},{"uid":"c574-0"}],"importedBy":[{"uid":"c574-14"}]},"c574-14":{"id":"/src/index.ts","moduleParts":{"zip.esm.js":"c574-15"},"imported":[{"uid":"c574-4"},{"uid":"c574-6"},{"uid":"c574-8"},{"uid":"c574-10"},{"uid":"c574-12"},{"uid":"c574-16"},{"uid":"c574-0"}],"importedBy":[],"isEntry":true},"c574-16":{"id":"/src/types.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"c574-14"}]},"c574-17":{"id":"@tanstack/react-query","moduleParts":{},"imported":[],"importedBy":[{"uid":"c574-4"},{"uid":"c574-6"},{"uid":"c574-8"},{"uid":"c574-10"},{"uid":"c574-12"},{"uid":"c574-0"}],"isExternal":true}},"env":{"rollup":"2.77.2"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
|
|
4018
4018
|
|
|
4019
4019
|
const run = () => {
|
|
4020
4020
|
const width = window.innerWidth;
|