react-query-kit 3.3.2 → 3.3.3
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 +1 -1
- package/build/lib/router.esm.js +20 -9
- package/build/lib/router.esm.js.map +1 -1
- package/build/lib/router.js +20 -9
- package/build/lib/router.js.map +1 -1
- package/build/lib/router.mjs +20 -9
- package/build/lib/router.mjs.map +1 -1
- package/build/lib/types.d.ts +14 -8
- package/build/stats-html.html +1 -1
- package/build/stats.json +97 -97
- package/build/umd/index.development.js +20 -9
- 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 +3 -3
- package/src/router.ts +30 -15
- package/src/types.ts +26 -11
package/README.md
CHANGED
package/build/lib/router.esm.js
CHANGED
|
@@ -4,18 +4,29 @@ import { createQuery } from './createQuery.esm.js';
|
|
|
4
4
|
import { createSuspenseInfiniteQuery } from './createSuspenseInfiniteQuery.esm.js';
|
|
5
5
|
import { createSuspenseQuery } from './createSuspenseQuery.esm.js';
|
|
6
6
|
|
|
7
|
+
const isRouterLeaf = value => {
|
|
8
|
+
return !!value && typeof value._routerType === 'string';
|
|
9
|
+
};
|
|
10
|
+
|
|
7
11
|
const buildRouter = (keys, config) => {
|
|
8
12
|
return Object.entries(config).reduce((acc, [key, opts]) => {
|
|
9
|
-
if (!opts
|
|
13
|
+
if (!isRouterLeaf(opts)) {
|
|
10
14
|
acc[key] = buildRouter([...keys, key], opts);
|
|
11
15
|
} else {
|
|
16
|
+
const type = opts._routerType;
|
|
12
17
|
const options = { ...opts,
|
|
13
|
-
[
|
|
18
|
+
[type === "m" ? "mutationKey" : "queryKey"]: [...keys, key]
|
|
14
19
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
|
|
21
|
+
if (type === "m") {
|
|
22
|
+
acc[key] = {
|
|
23
|
+
useMutation: createMutation(options),
|
|
24
|
+
...createMutation(options)
|
|
25
|
+
};
|
|
26
|
+
return acc;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
acc[key] = type === "q" ? {
|
|
19
30
|
useQuery: createQuery(options),
|
|
20
31
|
useSuspenseQuery: createSuspenseQuery(options),
|
|
21
32
|
...createQuery(options)
|
|
@@ -38,19 +49,19 @@ const router = (key, config) => {
|
|
|
38
49
|
|
|
39
50
|
function query(options) {
|
|
40
51
|
return { ...options,
|
|
41
|
-
|
|
52
|
+
_routerType: 'q'
|
|
42
53
|
};
|
|
43
54
|
}
|
|
44
55
|
|
|
45
56
|
function infiniteQuery(options) {
|
|
46
57
|
return { ...options,
|
|
47
|
-
|
|
58
|
+
_routerType: 'inf'
|
|
48
59
|
};
|
|
49
60
|
}
|
|
50
61
|
|
|
51
62
|
function mutation(options) {
|
|
52
63
|
return { ...options,
|
|
53
|
-
|
|
64
|
+
_routerType: 'm'
|
|
54
65
|
};
|
|
55
66
|
}
|
|
56
67
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.esm.js","sources":["../../src/router.ts"],"sourcesContent":["import { QueryKey } from '@tanstack/react-query'\n\nimport { createInfiniteQuery } from './createInfiniteQuery'\nimport { createMutation } from './createMutation'\nimport { createQuery } from './createQuery'\nimport { createSuspenseInfiniteQuery } from './createSuspenseInfiniteQuery'\nimport { createSuspenseQuery } from './createSuspenseQuery'\nimport type {\n CompatibleError,\n CreateRouter,\n RouterConfig,\n RouterInfiniteQuery,\n RouterInfiniteQueryOptions,\n RouterMutation,\n RouterMutationOptions,\n RouterQuery,\n RouterQueryOptions,\n} from './types'\n\nconst buildRouter = (keys: QueryKey, config: RouterConfig) => {\n return Object.entries(config).reduce(\n (acc, [key, opts]) => {\n if (!opts
|
|
1
|
+
{"version":3,"file":"router.esm.js","sources":["../../src/router.ts"],"sourcesContent":["import { QueryKey } from '@tanstack/react-query'\n\nimport { createInfiniteQuery } from './createInfiniteQuery'\nimport { createMutation } from './createMutation'\nimport { createQuery } from './createQuery'\nimport { createSuspenseInfiniteQuery } from './createSuspenseInfiniteQuery'\nimport { createSuspenseQuery } from './createSuspenseQuery'\nimport type {\n CompatibleError,\n CreateRouter,\n RouterConfig,\n RouterInfiniteQuery,\n RouterInfiniteQueryOptions,\n RouterMutation,\n RouterMutationOptions,\n RouterQuery,\n RouterQueryOptions,\n} from './types'\n\ntype RouterNode = RouterConfig[string]\ntype RouterTypedNode = RouterNode & {\n _routerType: 'q' | 'inf' | 'm'\n}\n\nconst isRouterLeaf = (value: RouterNode): value is RouterTypedNode => {\n return !!value && typeof value._routerType === 'string'\n}\n\nconst buildRouter = (keys: QueryKey, config: RouterConfig) => {\n return Object.entries(config).reduce(\n (acc, [key, opts]) => {\n if (!isRouterLeaf(opts)) {\n acc[key] = buildRouter([...keys, key], opts)\n } else {\n const type = opts._routerType\n const options: any = {\n ...opts,\n [type === `m` ? `mutationKey` : `queryKey`]: [...keys, key],\n }\n\n if (type === `m`) {\n acc[key] = {\n useMutation: createMutation(options),\n ...createMutation(options),\n }\n return acc\n }\n\n acc[key] =\n type === `q`\n ? {\n useQuery: createQuery(options),\n useSuspenseQuery: createSuspenseQuery(options),\n ...createQuery(options),\n }\n : {\n useInfiniteQuery: createInfiniteQuery(options),\n useSuspenseInfiniteQuery: createSuspenseInfiniteQuery(options),\n ...createInfiniteQuery(options),\n }\n }\n\n return acc\n },\n {\n getKey: () => keys,\n } as any\n )\n}\n\nexport const router = <TConfig extends RouterConfig>(\n key: string | QueryKey,\n config: TConfig\n): CreateRouter<TConfig> => {\n return buildRouter(Array.isArray(key) ? key : [key], config)\n}\n\nfunction query<TFnData, TVariables = void, TError = CompatibleError>(\n options: RouterQueryOptions<TFnData, TVariables, TError>\n): RouterQuery<TFnData, TVariables, TError> {\n return {\n ...options,\n _routerType: 'q',\n }\n}\n\nfunction infiniteQuery<\n TFnData,\n TVariables = void,\n TError = CompatibleError,\n TPageParam = number\n>(\n options: RouterInfiniteQueryOptions<TFnData, TVariables, TError, TPageParam>\n): RouterInfiniteQuery<TFnData, TVariables, TError, TPageParam> {\n return { ...options, _routerType: 'inf' } as RouterInfiniteQuery<\n TFnData,\n TVariables,\n TError,\n TPageParam\n >\n}\n\nfunction mutation<\n TFnData = unknown,\n TVariables = void,\n TError = CompatibleError,\n TContext = unknown\n>(\n options: RouterMutationOptions<TFnData, TVariables, TError, TContext>\n): RouterMutation<TFnData, TVariables, TError, TContext> {\n return { ...options, _routerType: 'm' } as RouterMutation<\n TFnData,\n TVariables,\n TError,\n TContext\n >\n}\n\nrouter.query = query\nrouter.infiniteQuery = infiniteQuery\nrouter.mutation = mutation\n"],"names":["isRouterLeaf","value","_routerType","buildRouter","keys","config","Object","entries","reduce","acc","key","opts","type","options","useMutation","createMutation","useQuery","createQuery","useSuspenseQuery","createSuspenseQuery","useInfiniteQuery","createInfiniteQuery","useSuspenseInfiniteQuery","createSuspenseInfiniteQuery","getKey","router","Array","isArray","query","infiniteQuery","mutation"],"mappings":";;;;;;AAwBA,MAAMA,YAAY,GAAIC,KAAD,IAAiD;EACpE,OAAO,CAAC,CAACA,KAAF,IAAW,OAAOA,KAAK,CAACC,WAAb,KAA6B,QAA/C,CAAA;AACD,CAFD,CAAA;;AAIA,MAAMC,WAAW,GAAG,CAACC,IAAD,EAAiBC,MAAjB,KAA0C;AAC5D,EAAA,OAAOC,MAAM,CAACC,OAAP,CAAeF,MAAf,EAAuBG,MAAvB,CACL,CAACC,GAAD,EAAM,CAACC,GAAD,EAAMC,IAAN,CAAN,KAAsB;AACpB,IAAA,IAAI,CAACX,YAAY,CAACW,IAAD,CAAjB,EAAyB;AACvBF,MAAAA,GAAG,CAACC,GAAD,CAAH,GAAWP,WAAW,CAAC,CAAC,GAAGC,IAAJ,EAAUM,GAAV,CAAD,EAAiBC,IAAjB,CAAtB,CAAA;AACD,KAFD,MAEO;AACL,MAAA,MAAMC,IAAI,GAAGD,IAAI,CAACT,WAAlB,CAAA;AACA,MAAA,MAAMW,OAAY,GAAG,EACnB,GA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aAAT,CAMEhB,OANF,EAOgE;EAC9D,OAAO,EAAE,GAAGA,OAAL;AAAcX,IAAAA,WAAW,EAAE,KAAA;GAAlC,CAAA;AAMD,CAAA;;AAED,SAAS4B,QAAT,CAMEjB,OANF,EAOyD;EACvD,OAAO,EAAE,GAAGA,OAAL;AAAcX,IAAAA,WAAW,EAAE,GAAA;GAAlC,CAAA;AAMD,CAAA;;AAEDuB,MAAM,CAACG,KAAP,GAAeA,KAAf,CAAA;AACAH,MAAM,CAACI,aAAP,GAAuBA,aAAvB,CAAA;AACAJ,MAAM,CAACK,QAAP,GAAkBA,QAAlB;;;;"}
|
package/build/lib/router.js
CHANGED
|
@@ -8,18 +8,29 @@ var createQuery = require('./createQuery.js');
|
|
|
8
8
|
var createSuspenseInfiniteQuery = require('./createSuspenseInfiniteQuery.js');
|
|
9
9
|
var createSuspenseQuery = require('./createSuspenseQuery.js');
|
|
10
10
|
|
|
11
|
+
const isRouterLeaf = value => {
|
|
12
|
+
return !!value && typeof value._routerType === 'string';
|
|
13
|
+
};
|
|
14
|
+
|
|
11
15
|
const buildRouter = (keys, config) => {
|
|
12
16
|
return Object.entries(config).reduce((acc, [key, opts]) => {
|
|
13
|
-
if (!opts
|
|
17
|
+
if (!isRouterLeaf(opts)) {
|
|
14
18
|
acc[key] = buildRouter([...keys, key], opts);
|
|
15
19
|
} else {
|
|
20
|
+
const type = opts._routerType;
|
|
16
21
|
const options = { ...opts,
|
|
17
|
-
[
|
|
22
|
+
[type === "m" ? "mutationKey" : "queryKey"]: [...keys, key]
|
|
18
23
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
|
|
25
|
+
if (type === "m") {
|
|
26
|
+
acc[key] = {
|
|
27
|
+
useMutation: createMutation.createMutation(options),
|
|
28
|
+
...createMutation.createMutation(options)
|
|
29
|
+
};
|
|
30
|
+
return acc;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
acc[key] = type === "q" ? {
|
|
23
34
|
useQuery: createQuery.createQuery(options),
|
|
24
35
|
useSuspenseQuery: createSuspenseQuery.createSuspenseQuery(options),
|
|
25
36
|
...createQuery.createQuery(options)
|
|
@@ -42,19 +53,19 @@ const router = (key, config) => {
|
|
|
42
53
|
|
|
43
54
|
function query(options) {
|
|
44
55
|
return { ...options,
|
|
45
|
-
|
|
56
|
+
_routerType: 'q'
|
|
46
57
|
};
|
|
47
58
|
}
|
|
48
59
|
|
|
49
60
|
function infiniteQuery(options) {
|
|
50
61
|
return { ...options,
|
|
51
|
-
|
|
62
|
+
_routerType: 'inf'
|
|
52
63
|
};
|
|
53
64
|
}
|
|
54
65
|
|
|
55
66
|
function mutation(options) {
|
|
56
67
|
return { ...options,
|
|
57
|
-
|
|
68
|
+
_routerType: 'm'
|
|
58
69
|
};
|
|
59
70
|
}
|
|
60
71
|
|
package/build/lib/router.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.js","sources":["../../src/router.ts"],"sourcesContent":["import { QueryKey } from '@tanstack/react-query'\n\nimport { createInfiniteQuery } from './createInfiniteQuery'\nimport { createMutation } from './createMutation'\nimport { createQuery } from './createQuery'\nimport { createSuspenseInfiniteQuery } from './createSuspenseInfiniteQuery'\nimport { createSuspenseQuery } from './createSuspenseQuery'\nimport type {\n CompatibleError,\n CreateRouter,\n RouterConfig,\n RouterInfiniteQuery,\n RouterInfiniteQueryOptions,\n RouterMutation,\n RouterMutationOptions,\n RouterQuery,\n RouterQueryOptions,\n} from './types'\n\nconst buildRouter = (keys: QueryKey, config: RouterConfig) => {\n return Object.entries(config).reduce(\n (acc, [key, opts]) => {\n if (!opts
|
|
1
|
+
{"version":3,"file":"router.js","sources":["../../src/router.ts"],"sourcesContent":["import { QueryKey } from '@tanstack/react-query'\n\nimport { createInfiniteQuery } from './createInfiniteQuery'\nimport { createMutation } from './createMutation'\nimport { createQuery } from './createQuery'\nimport { createSuspenseInfiniteQuery } from './createSuspenseInfiniteQuery'\nimport { createSuspenseQuery } from './createSuspenseQuery'\nimport type {\n CompatibleError,\n CreateRouter,\n RouterConfig,\n RouterInfiniteQuery,\n RouterInfiniteQueryOptions,\n RouterMutation,\n RouterMutationOptions,\n RouterQuery,\n RouterQueryOptions,\n} from './types'\n\ntype RouterNode = RouterConfig[string]\ntype RouterTypedNode = RouterNode & {\n _routerType: 'q' | 'inf' | 'm'\n}\n\nconst isRouterLeaf = (value: RouterNode): value is RouterTypedNode => {\n return !!value && typeof value._routerType === 'string'\n}\n\nconst buildRouter = (keys: QueryKey, config: RouterConfig) => {\n return Object.entries(config).reduce(\n (acc, [key, opts]) => {\n if (!isRouterLeaf(opts)) {\n acc[key] = buildRouter([...keys, key], opts)\n } else {\n const type = opts._routerType\n const options: any = {\n ...opts,\n [type === `m` ? `mutationKey` : `queryKey`]: [...keys, key],\n }\n\n if (type === `m`) {\n acc[key] = {\n useMutation: createMutation(options),\n ...createMutation(options),\n }\n return acc\n }\n\n acc[key] =\n type === `q`\n ? {\n useQuery: createQuery(options),\n useSuspenseQuery: createSuspenseQuery(options),\n ...createQuery(options),\n }\n : {\n useInfiniteQuery: createInfiniteQuery(options),\n useSuspenseInfiniteQuery: createSuspenseInfiniteQuery(options),\n ...createInfiniteQuery(options),\n }\n }\n\n return acc\n },\n {\n getKey: () => keys,\n } as any\n )\n}\n\nexport const router = <TConfig extends RouterConfig>(\n key: string | QueryKey,\n config: TConfig\n): CreateRouter<TConfig> => {\n return buildRouter(Array.isArray(key) ? key : [key], config)\n}\n\nfunction query<TFnData, TVariables = void, TError = CompatibleError>(\n options: RouterQueryOptions<TFnData, TVariables, TError>\n): RouterQuery<TFnData, TVariables, TError> {\n return {\n ...options,\n _routerType: 'q',\n }\n}\n\nfunction infiniteQuery<\n TFnData,\n TVariables = void,\n TError = CompatibleError,\n TPageParam = number\n>(\n options: RouterInfiniteQueryOptions<TFnData, TVariables, TError, TPageParam>\n): RouterInfiniteQuery<TFnData, TVariables, TError, TPageParam> {\n return { ...options, _routerType: 'inf' } as RouterInfiniteQuery<\n TFnData,\n TVariables,\n TError,\n TPageParam\n >\n}\n\nfunction mutation<\n TFnData = unknown,\n TVariables = void,\n TError = CompatibleError,\n TContext = unknown\n>(\n options: RouterMutationOptions<TFnData, TVariables, TError, TContext>\n): RouterMutation<TFnData, TVariables, TError, TContext> {\n return { ...options, _routerType: 'm' } as RouterMutation<\n TFnData,\n TVariables,\n TError,\n TContext\n >\n}\n\nrouter.query = query\nrouter.infiniteQuery = infiniteQuery\nrouter.mutation = mutation\n"],"names":["isRouterLeaf","value","_routerType","buildRouter","keys","config","Object","entries","reduce","acc","key","opts","type","options","useMutation","createMutation","useQuery","createQuery","useSuspenseQuery","createSuspenseQuery","useInfiniteQuery","createInfiniteQuery","useSuspenseInfiniteQuery","createSuspenseInfiniteQuery","getKey","router","Array","isArray","query","infiniteQuery","mutation"],"mappings":";;;;;;;;;;AAwBA,MAAMA,YAAY,GAAIC,KAAD,IAAiD;EACpE,OAAO,CAAC,CAACA,KAAF,IAAW,OAAOA,KAAK,CAACC,WAAb,KAA6B,QAA/C,CAAA;AACD,CAFD,CAAA;;AAIA,MAAMC,WAAW,GAAG,CAACC,IAAD,EAAiBC,MAAjB,KAA0C;AAC5D,EAAA,OAAOC,MAAM,CAACC,OAAP,CAAeF,MAAf,EAAuBG,MAAvB,CACL,CAACC,GAAD,EAAM,CAACC,GAAD,EAAMC,IAAN,CAAN,KAAsB;AACpB,IAAA,IAAI,CAACX,YAAY,CAACW,IAAD,CAAjB,EAAyB;AACvBF,MAAAA,GAAG,CAACC,GAAD,CAAH,GAAWP,WAAW,CAAC,CAAC,GAAGC,IAAJ,EAAUM,GAAV,CAAD,EAAiBC,IAAjB,CAAtB,CAAA;AACD,KAFD,MAEO;AACL,MAAA,MAAMC,IAAI,GAAGD,IAAI,CAACT,WAAlB,CAAA;AACA,MAAA,MAAMW,OAAY,GAAG,EACnB,GAAGF,IADgB;QAEnB,CAACC,IAAI,QAAJ,GAAD,aAAA,GAAA,U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,OAAL;AAAcX,IAAAA,WAAW,EAAE,KAAA;GAAlC,CAAA;AAMD,CAAA;;AAED,SAAS4B,QAAT,CAMEjB,OANF,EAOyD;EACvD,OAAO,EAAE,GAAGA,OAAL;AAAcX,IAAAA,WAAW,EAAE,GAAA;GAAlC,CAAA;AAMD,CAAA;;AAEDuB,MAAM,CAACG,KAAP,GAAeA,KAAf,CAAA;AACAH,MAAM,CAACI,aAAP,GAAuBA,aAAvB,CAAA;AACAJ,MAAM,CAACK,QAAP,GAAkBA,QAAlB;;;;"}
|
package/build/lib/router.mjs
CHANGED
|
@@ -4,18 +4,29 @@ import { createQuery } from './createQuery.mjs';
|
|
|
4
4
|
import { createSuspenseInfiniteQuery } from './createSuspenseInfiniteQuery.mjs';
|
|
5
5
|
import { createSuspenseQuery } from './createSuspenseQuery.mjs';
|
|
6
6
|
|
|
7
|
+
const isRouterLeaf = value => {
|
|
8
|
+
return !!value && typeof value._routerType === 'string';
|
|
9
|
+
};
|
|
10
|
+
|
|
7
11
|
const buildRouter = (keys, config) => {
|
|
8
12
|
return Object.entries(config).reduce((acc, [key, opts]) => {
|
|
9
|
-
if (!opts
|
|
13
|
+
if (!isRouterLeaf(opts)) {
|
|
10
14
|
acc[key] = buildRouter([...keys, key], opts);
|
|
11
15
|
} else {
|
|
16
|
+
const type = opts._routerType;
|
|
12
17
|
const options = { ...opts,
|
|
13
|
-
[
|
|
18
|
+
[type === "m" ? "mutationKey" : "queryKey"]: [...keys, key]
|
|
14
19
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
|
|
21
|
+
if (type === "m") {
|
|
22
|
+
acc[key] = {
|
|
23
|
+
useMutation: createMutation(options),
|
|
24
|
+
...createMutation(options)
|
|
25
|
+
};
|
|
26
|
+
return acc;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
acc[key] = type === "q" ? {
|
|
19
30
|
useQuery: createQuery(options),
|
|
20
31
|
useSuspenseQuery: createSuspenseQuery(options),
|
|
21
32
|
...createQuery(options)
|
|
@@ -38,19 +49,19 @@ const router = (key, config) => {
|
|
|
38
49
|
|
|
39
50
|
function query(options) {
|
|
40
51
|
return { ...options,
|
|
41
|
-
|
|
52
|
+
_routerType: 'q'
|
|
42
53
|
};
|
|
43
54
|
}
|
|
44
55
|
|
|
45
56
|
function infiniteQuery(options) {
|
|
46
57
|
return { ...options,
|
|
47
|
-
|
|
58
|
+
_routerType: 'inf'
|
|
48
59
|
};
|
|
49
60
|
}
|
|
50
61
|
|
|
51
62
|
function mutation(options) {
|
|
52
63
|
return { ...options,
|
|
53
|
-
|
|
64
|
+
_routerType: 'm'
|
|
54
65
|
};
|
|
55
66
|
}
|
|
56
67
|
|
package/build/lib/router.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.mjs","sources":["../../src/router.ts"],"sourcesContent":["import { QueryKey } from '@tanstack/react-query'\n\nimport { createInfiniteQuery } from './createInfiniteQuery'\nimport { createMutation } from './createMutation'\nimport { createQuery } from './createQuery'\nimport { createSuspenseInfiniteQuery } from './createSuspenseInfiniteQuery'\nimport { createSuspenseQuery } from './createSuspenseQuery'\nimport type {\n CompatibleError,\n CreateRouter,\n RouterConfig,\n RouterInfiniteQuery,\n RouterInfiniteQueryOptions,\n RouterMutation,\n RouterMutationOptions,\n RouterQuery,\n RouterQueryOptions,\n} from './types'\n\nconst buildRouter = (keys: QueryKey, config: RouterConfig) => {\n return Object.entries(config).reduce(\n (acc, [key, opts]) => {\n if (!opts
|
|
1
|
+
{"version":3,"file":"router.mjs","sources":["../../src/router.ts"],"sourcesContent":["import { QueryKey } from '@tanstack/react-query'\n\nimport { createInfiniteQuery } from './createInfiniteQuery'\nimport { createMutation } from './createMutation'\nimport { createQuery } from './createQuery'\nimport { createSuspenseInfiniteQuery } from './createSuspenseInfiniteQuery'\nimport { createSuspenseQuery } from './createSuspenseQuery'\nimport type {\n CompatibleError,\n CreateRouter,\n RouterConfig,\n RouterInfiniteQuery,\n RouterInfiniteQueryOptions,\n RouterMutation,\n RouterMutationOptions,\n RouterQuery,\n RouterQueryOptions,\n} from './types'\n\ntype RouterNode = RouterConfig[string]\ntype RouterTypedNode = RouterNode & {\n _routerType: 'q' | 'inf' | 'm'\n}\n\nconst isRouterLeaf = (value: RouterNode): value is RouterTypedNode => {\n return !!value && typeof value._routerType === 'string'\n}\n\nconst buildRouter = (keys: QueryKey, config: RouterConfig) => {\n return Object.entries(config).reduce(\n (acc, [key, opts]) => {\n if (!isRouterLeaf(opts)) {\n acc[key] = buildRouter([...keys, key], opts)\n } else {\n const type = opts._routerType\n const options: any = {\n ...opts,\n [type === `m` ? `mutationKey` : `queryKey`]: [...keys, key],\n }\n\n if (type === `m`) {\n acc[key] = {\n useMutation: createMutation(options),\n ...createMutation(options),\n }\n return acc\n }\n\n acc[key] =\n type === `q`\n ? {\n useQuery: createQuery(options),\n useSuspenseQuery: createSuspenseQuery(options),\n ...createQuery(options),\n }\n : {\n useInfiniteQuery: createInfiniteQuery(options),\n useSuspenseInfiniteQuery: createSuspenseInfiniteQuery(options),\n ...createInfiniteQuery(options),\n }\n }\n\n return acc\n },\n {\n getKey: () => keys,\n } as any\n )\n}\n\nexport const router = <TConfig extends RouterConfig>(\n key: string | QueryKey,\n config: TConfig\n): CreateRouter<TConfig> => {\n return buildRouter(Array.isArray(key) ? key : [key], config)\n}\n\nfunction query<TFnData, TVariables = void, TError = CompatibleError>(\n options: RouterQueryOptions<TFnData, TVariables, TError>\n): RouterQuery<TFnData, TVariables, TError> {\n return {\n ...options,\n _routerType: 'q',\n }\n}\n\nfunction infiniteQuery<\n TFnData,\n TVariables = void,\n TError = CompatibleError,\n TPageParam = number\n>(\n options: RouterInfiniteQueryOptions<TFnData, TVariables, TError, TPageParam>\n): RouterInfiniteQuery<TFnData, TVariables, TError, TPageParam> {\n return { ...options, _routerType: 'inf' } as RouterInfiniteQuery<\n TFnData,\n TVariables,\n TError,\n TPageParam\n >\n}\n\nfunction mutation<\n TFnData = unknown,\n TVariables = void,\n TError = CompatibleError,\n TContext = unknown\n>(\n options: RouterMutationOptions<TFnData, TVariables, TError, TContext>\n): RouterMutation<TFnData, TVariables, TError, TContext> {\n return { ...options, _routerType: 'm' } as RouterMutation<\n TFnData,\n TVariables,\n TError,\n TContext\n >\n}\n\nrouter.query = query\nrouter.infiniteQuery = infiniteQuery\nrouter.mutation = mutation\n"],"names":["isRouterLeaf","value","_routerType","buildRouter","keys","config","Object","entries","reduce","acc","key","opts","type","options","useMutation","createMutation","useQuery","createQuery","useSuspenseQuery","createSuspenseQuery","useInfiniteQuery","createInfiniteQuery","useSuspenseInfiniteQuery","createSuspenseInfiniteQuery","getKey","router","Array","isArray","query","infiniteQuery","mutation"],"mappings":";;;;;;AAwBA,MAAMA,YAAY,GAAIC,KAAD,IAAiD;EACpE,OAAO,CAAC,CAACA,KAAF,IAAW,OAAOA,KAAK,CAACC,WAAb,KAA6B,QAA/C,CAAA;AACD,CAFD,CAAA;;AAIA,MAAMC,WAAW,GAAG,CAACC,IAAD,EAAiBC,MAAjB,KAA0C;AAC5D,EAAA,OAAOC,MAAM,CAACC,OAAP,CAAeF,MAAf,EAAuBG,MAAvB,CACL,CAACC,GAAD,EAAM,CAACC,GAAD,EAAMC,IAAN,CAAN,KAAsB;AACpB,IAAA,IAAI,CAACX,YAAY,CAACW,IAAD,CAAjB,EAAyB;AACvBF,MAAAA,GAAG,CAACC,GAAD,CAAH,GAAWP,WAAW,CAAC,CAAC,GAAGC,IAAJ,EAAUM,GAAV,CAAD,EAAiBC,IAAjB,CAAtB,CAAA;AACD,KAFD,MAEO;AACL,MAAA,MAAMC,IAAI,GAAGD,IAAI,CAACT,WAAlB,CAAA;AACA,MAAA,MAAMW,OAAY,GAAG,EACnB,GAAGF,IADgB;QAEnB,CAACC,IAAI,QAAJ,GAAD,aAAA,GAAA,UAAA,GAA6C,CAAC,GAAGR,IAAJ,EAAUM,GAAV,CAAA;OAF/C,CAAA;;MAKA,IAA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AAT,CAMEjB,OANF,EAOyD;EACvD,OAAO,EAAE,GAAGA,OAAL;AAAcX,IAAAA,WAAW,EAAE,GAAA;GAAlC,CAAA;AAMD,CAAA;;AAEDuB,MAAM,CAACG,KAAP,GAAeA,KAAf,CAAA;AACAH,MAAM,CAACI,aAAP,GAAuBA,aAAvB,CAAA;AACAJ,MAAM,CAACK,QAAP,GAAkBA,QAAlB;;;;"}
|
package/build/lib/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DataTag, DefaultError, DefinedUseInfiniteQueryResult, DefinedUseQueryResult, InfiniteData, InfiniteQueryObserverSuccessResult,
|
|
1
|
+
import type { DataTag, DefaultError, DefinedUseInfiniteQueryResult, DefinedUseQueryResult, InfiniteData, InfiniteQueryObserverSuccessResult, MutationFunctionContext, MutationKey, QueryClient, QueryFunction, QueryFunctionContext, QueryKey, QueryKeyHashFunction, QueryObserverSuccessResult, SkipToken, 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
3
|
type CompatibleWithTwoV5<V6Generics, V5Generics> = UseInfiniteQueryOptions<unknown, DefaultError, unknown, QueryKey, unknown> extends never ? V5Generics : V6Generics;
|
|
4
4
|
type CompatibleUseInfiniteQueryOptions<TFnData, TData, TError, TPageParam> = CompatibleWithV4<CompatibleWithTwoV5<UseInfiniteQueryOptions<TFnData, TError, TData, QueryKey, TPageParam>, UseInfiniteQueryOptions<TFnData, TError, TData, TFnData, QueryKey, TPageParam>>, UseInfiniteQueryOptions<TFnData, TError, TData, TFnData, QueryKey>>;
|
|
@@ -109,10 +109,13 @@ export interface MutationHookOptions<TData, TError, TVariables, TContext> extend
|
|
|
109
109
|
use?: Middleware<MutationHook<TData, TVariables, TError>>[];
|
|
110
110
|
}
|
|
111
111
|
export type MutationHookResult<TData = unknown, TError = CompatibleError, TVariables = void, TContext = unknown> = UseMutationResult<TData, TError, TVariables, TContext>;
|
|
112
|
+
export type ExposeMutationFn<TData = unknown, TVariables = void> = [
|
|
113
|
+
TVariables
|
|
114
|
+
] extends [void] ? (variables?: TVariables, context?: Partial<MutationFunctionContext>) => Promise<TData> : (variables: TVariables, context?: Partial<MutationFunctionContext>) => Promise<TData>;
|
|
112
115
|
export interface ExposeMutationMethods<TData = unknown, TVariables = void, TError = CompatibleError, TDefaultContext = unknown> {
|
|
113
116
|
getKey: () => MutationKey | undefined;
|
|
114
117
|
getOptions: () => UseMutationOptions<TData, TError, TVariables, TDefaultContext>;
|
|
115
|
-
mutationFn:
|
|
118
|
+
mutationFn: ExposeMutationFn<TData, TVariables>;
|
|
116
119
|
}
|
|
117
120
|
export interface MutationHook<TData = unknown, TVariables = void, TError = CompatibleError, TDefaultContext = unknown> extends ExposeMutationMethods<TData, TVariables, TError, TDefaultContext> {
|
|
118
121
|
<TContext = TDefaultContext>(options?: MutationHookOptions<TData, TError, TVariables, TContext>, queryClient?: CompatibleWithV4<QueryClient, void>): MutationHookResult<TData, TError, TVariables, TContext>;
|
|
@@ -131,7 +134,7 @@ export type inferOptions<T> = T extends QueryHook<infer TFnData, infer TVariable
|
|
|
131
134
|
export type inferCreateOptions<T> = T extends QueryHook<infer TFnData, infer TVariables, infer TError> ? CreateQueryOptions<TFnData, TVariables, TError> : T extends SuspenseQueryHook<infer TFnData, infer TVariables, infer TError> ? CreateSuspenseQueryOptions<TFnData, TVariables, TError> : T extends InfiniteQueryHook<infer TFnData, infer TVariables, infer TError, infer TPageParam> ? CreateInfiniteQueryOptions<TFnData, TVariables, TError, TPageParam> : T extends SuspenseInfiniteQueryHook<infer TFnData, infer TVariables, infer TError, infer TPageParam> ? CreateSuspenseInfiniteQueryOptions<TFnData, TVariables, TError, TPageParam> : T extends MutationHook<infer TFnData, infer TVariables, infer TError, infer TContext> ? CreateMutationOptions<TFnData, TVariables, TError, TContext> : never;
|
|
132
135
|
export type RouterQueryOptions<TFnData, TVariables = void, TError = CompatibleError> = Omit<CreateQueryOptions<TFnData, TVariables, TError>, 'queryKey'>;
|
|
133
136
|
export type RouterQuery<TFnData, TVariables = void, TError = CompatibleError> = RouterQueryOptions<TFnData, TVariables, TError> & {
|
|
134
|
-
|
|
137
|
+
_routerType: `q`;
|
|
135
138
|
};
|
|
136
139
|
export type ResolvedRouterQuery<TFnData, TVariables = void, TError = CompatibleError> = {
|
|
137
140
|
useQuery: QueryHook<TFnData, TVariables, TError>;
|
|
@@ -139,7 +142,7 @@ export type ResolvedRouterQuery<TFnData, TVariables = void, TError = CompatibleE
|
|
|
139
142
|
} & ExposeMethods<TFnData, TVariables, TError>;
|
|
140
143
|
export type RouterInfiniteQueryOptions<TFnData, TVariables = void, TError = CompatibleError, TPageParam = number> = Omit<CreateInfiniteQueryOptions<TFnData, TVariables, TError, TPageParam>, 'queryKey'>;
|
|
141
144
|
export type RouterInfiniteQuery<TFnData, TVariables = void, TError = CompatibleError, TPageParam = number> = RouterInfiniteQueryOptions<TFnData, TVariables, TError, Clone<TPageParam>> & {
|
|
142
|
-
|
|
145
|
+
_routerType: `inf`;
|
|
143
146
|
};
|
|
144
147
|
export type ResolvedRouterInfiniteQuery<TFnData, TVariables = void, TError = CompatibleError, TPageParam = number> = {
|
|
145
148
|
useInfiniteQuery: InfiniteQueryHook<TFnData, TVariables, TError, TPageParam>;
|
|
@@ -147,14 +150,17 @@ export type ResolvedRouterInfiniteQuery<TFnData, TVariables = void, TError = Com
|
|
|
147
150
|
} & ExposeMethods<TFnData, TVariables, TError, TPageParam>;
|
|
148
151
|
export type RouterMutationOptions<TData = unknown, TVariables = void, TError = CompatibleError, TContext = unknown> = Omit<CreateMutationOptions<TData, TVariables, TError, TContext>, 'mutationKey'>;
|
|
149
152
|
export type RouterMutation<TData = unknown, TVariables = void, TError = CompatibleError, TContext = unknown> = RouterMutationOptions<TData, TVariables, TError, TContext> & {
|
|
150
|
-
|
|
153
|
+
_routerType: `m`;
|
|
151
154
|
};
|
|
152
155
|
export type ResolvedRouterMutation<TData = unknown, TVariables = void, TError = CompatibleError, TContext = unknown> = {
|
|
153
156
|
useMutation: MutationHook<TData, DefaultTo<TVariables, void>, DefaultTo<TError, CompatibleError>, TContext>;
|
|
154
157
|
} & ExposeMutationMethods<TData, DefaultTo<TVariables, void>, DefaultTo<TError, CompatibleError>, TContext>;
|
|
155
|
-
export
|
|
156
|
-
|
|
157
|
-
|
|
158
|
+
export type RouterLeaf = RouterQuery<any, any, any> | RouterInfiniteQuery<any, any, any, any> | RouterMutation<any, any, any, any>;
|
|
159
|
+
export type RouterConfig = {
|
|
160
|
+
_routerType?: never;
|
|
161
|
+
} & {
|
|
162
|
+
[k: string]: RouterLeaf | RouterConfig;
|
|
163
|
+
};
|
|
158
164
|
export type CreateRouter<TConfig extends RouterConfig> = {
|
|
159
165
|
[K in keyof TConfig]: TConfig[K] extends RouterMutation<infer TFnData, infer TVariables, infer TError, infer TContext> ? ResolvedRouterMutation<TFnData, DefaultTo<TVariables, void>, DefaultTo<TError, CompatibleError>, TContext> : TConfig[K] extends RouterInfiniteQuery<infer TFnData, infer TVariables, infer TError, infer TPageParam> ? ResolvedRouterInfiniteQuery<TFnData, DefaultTo<TVariables, void>, DefaultTo<TError, CompatibleError>, DefaultTo<TPageParam, number>> : TConfig[K] extends RouterQuery<infer TFnData, infer TVariables, infer TError> ? ResolvedRouterQuery<TFnData, DefaultTo<TVariables, void>, DefaultTo<TError, CompatibleError>> : TConfig[K] extends RouterConfig ? CreateRouter<TConfig[K]> : never;
|
|
160
166
|
} & {
|
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":"index.production.js","children":[{"name":"src","children":[{"uid":"
|
|
4017
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.production.js","children":[{"name":"src","children":[{"uid":"b58a-1","name":"utils.ts"},{"uid":"b58a-3","name":"createBaseQuery.ts"},{"uid":"b58a-5","name":"createQuery.ts"},{"uid":"b58a-7","name":"createSuspenseQuery.ts"},{"uid":"b58a-9","name":"createInfiniteQuery.ts"},{"uid":"b58a-11","name":"createSuspenseInfiniteQuery.ts"},{"uid":"b58a-13","name":"createMutation.ts"},{"uid":"b58a-15","name":"router.ts"},{"uid":"b58a-17","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"b58a-1":{"renderedLength":925,"gzipLength":457,"brotliLength":0,"mainUid":"b58a-0"},"b58a-3":{"renderedLength":1366,"gzipLength":424,"brotliLength":0,"mainUid":"b58a-2"},"b58a-5":{"renderedLength":95,"gzipLength":84,"brotliLength":0,"mainUid":"b58a-4"},"b58a-7":{"renderedLength":183,"gzipLength":115,"brotliLength":0,"mainUid":"b58a-6"},"b58a-9":{"renderedLength":111,"gzipLength":93,"brotliLength":0,"mainUid":"b58a-8"},"b58a-11":{"renderedLength":207,"gzipLength":125,"brotliLength":0,"mainUid":"b58a-10"},"b58a-13":{"renderedLength":283,"gzipLength":170,"brotliLength":0,"mainUid":"b58a-12"},"b58a-15":{"renderedLength":1574,"gzipLength":505,"brotliLength":0,"mainUid":"b58a-14"},"b58a-17":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"b58a-16"}},"nodeMetas":{"b58a-0":{"id":"/src/utils.ts","moduleParts":{"index.production.js":"b58a-1"},"imported":[{"uid":"b58a-19"}],"importedBy":[{"uid":"b58a-16"},{"uid":"b58a-4"},{"uid":"b58a-6"},{"uid":"b58a-8"},{"uid":"b58a-10"},{"uid":"b58a-12"},{"uid":"b58a-2"}]},"b58a-2":{"id":"/src/createBaseQuery.ts","moduleParts":{"index.production.js":"b58a-3"},"imported":[{"uid":"b58a-0"}],"importedBy":[{"uid":"b58a-4"},{"uid":"b58a-6"},{"uid":"b58a-8"},{"uid":"b58a-10"}]},"b58a-4":{"id":"/src/createQuery.ts","moduleParts":{"index.production.js":"b58a-5"},"imported":[{"uid":"b58a-2"},{"uid":"b58a-0"}],"importedBy":[{"uid":"b58a-16"},{"uid":"b58a-14"}]},"b58a-6":{"id":"/src/createSuspenseQuery.ts","moduleParts":{"index.production.js":"b58a-7"},"imported":[{"uid":"b58a-2"},{"uid":"b58a-0"}],"importedBy":[{"uid":"b58a-16"},{"uid":"b58a-14"}]},"b58a-8":{"id":"/src/createInfiniteQuery.ts","moduleParts":{"index.production.js":"b58a-9"},"imported":[{"uid":"b58a-2"},{"uid":"b58a-0"}],"importedBy":[{"uid":"b58a-16"},{"uid":"b58a-14"}]},"b58a-10":{"id":"/src/createSuspenseInfiniteQuery.ts","moduleParts":{"index.production.js":"b58a-11"},"imported":[{"uid":"b58a-2"},{"uid":"b58a-0"}],"importedBy":[{"uid":"b58a-16"},{"uid":"b58a-14"}]},"b58a-12":{"id":"/src/createMutation.ts","moduleParts":{"index.production.js":"b58a-13"},"imported":[{"uid":"b58a-0"}],"importedBy":[{"uid":"b58a-16"},{"uid":"b58a-14"}]},"b58a-14":{"id":"/src/router.ts","moduleParts":{"index.production.js":"b58a-15"},"imported":[{"uid":"b58a-8"},{"uid":"b58a-12"},{"uid":"b58a-4"},{"uid":"b58a-10"},{"uid":"b58a-6"}],"importedBy":[{"uid":"b58a-16"}]},"b58a-16":{"id":"/src/index.ts","moduleParts":{"index.production.js":"b58a-17"},"imported":[{"uid":"b58a-4"},{"uid":"b58a-6"},{"uid":"b58a-8"},{"uid":"b58a-10"},{"uid":"b58a-12"},{"uid":"b58a-18"},{"uid":"b58a-14"},{"uid":"b58a-0"}],"importedBy":[],"isEntry":true},"b58a-18":{"id":"/src/types.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"b58a-16"}]},"b58a-19":{"id":"@tanstack/react-query","moduleParts":{},"imported":[],"importedBy":[{"uid":"b58a-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;
|