react-query-kit 3.2.1 → 3.2.2

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.
Files changed (57) hide show
  1. package/README.md +1 -1
  2. package/build/lib/createInfiniteQuery.d.ts +2 -2
  3. package/build/lib/createInfiniteQuery.esm.js +2 -2
  4. package/build/lib/createInfiniteQuery.esm.js.map +1 -1
  5. package/build/lib/createInfiniteQuery.js +2 -2
  6. package/build/lib/createInfiniteQuery.js.map +1 -1
  7. package/build/lib/createInfiniteQuery.mjs +2 -2
  8. package/build/lib/createInfiniteQuery.mjs.map +1 -1
  9. package/build/lib/createMutation.d.ts +2 -2
  10. package/build/lib/createMutation.esm.js +2 -2
  11. package/build/lib/createMutation.esm.js.map +1 -1
  12. package/build/lib/createMutation.js +2 -2
  13. package/build/lib/createMutation.js.map +1 -1
  14. package/build/lib/createMutation.mjs +2 -2
  15. package/build/lib/createMutation.mjs.map +1 -1
  16. package/build/lib/createQuery.d.ts +2 -2
  17. package/build/lib/createQuery.esm.js +2 -2
  18. package/build/lib/createQuery.esm.js.map +1 -1
  19. package/build/lib/createQuery.js +2 -2
  20. package/build/lib/createQuery.js.map +1 -1
  21. package/build/lib/createQuery.mjs +2 -2
  22. package/build/lib/createQuery.mjs.map +1 -1
  23. package/build/lib/createSuspenseInfiniteQuery.d.ts +2 -2
  24. package/build/lib/createSuspenseInfiniteQuery.esm.js +2 -2
  25. package/build/lib/createSuspenseInfiniteQuery.esm.js.map +1 -1
  26. package/build/lib/createSuspenseInfiniteQuery.js +2 -2
  27. package/build/lib/createSuspenseInfiniteQuery.js.map +1 -1
  28. package/build/lib/createSuspenseInfiniteQuery.mjs +2 -2
  29. package/build/lib/createSuspenseInfiniteQuery.mjs.map +1 -1
  30. package/build/lib/createSuspenseQuery.d.ts +2 -2
  31. package/build/lib/createSuspenseQuery.esm.js +2 -2
  32. package/build/lib/createSuspenseQuery.esm.js.map +1 -1
  33. package/build/lib/createSuspenseQuery.js +2 -2
  34. package/build/lib/createSuspenseQuery.js.map +1 -1
  35. package/build/lib/createSuspenseQuery.mjs +2 -2
  36. package/build/lib/createSuspenseQuery.mjs.map +1 -1
  37. package/build/lib/router.d.ts +8 -4
  38. package/build/lib/router.esm.js +10 -6
  39. package/build/lib/router.esm.js.map +1 -1
  40. package/build/lib/router.js +10 -6
  41. package/build/lib/router.js.map +1 -1
  42. package/build/lib/router.mjs +10 -6
  43. package/build/lib/router.mjs.map +1 -1
  44. package/build/stats-html.html +1 -1
  45. package/build/stats.json +107 -107
  46. package/build/umd/index.development.js +20 -16
  47. package/build/umd/index.development.js.map +1 -1
  48. package/build/umd/index.production.js +1 -1
  49. package/build/umd/index.production.js.map +1 -1
  50. package/build/zip/zip.esm.js +1 -1
  51. package/package.json +1 -1
  52. package/src/createInfiniteQuery.ts +2 -2
  53. package/src/createMutation.ts +2 -2
  54. package/src/createQuery.ts +2 -2
  55. package/src/createSuspenseInfiniteQuery.ts +2 -2
  56. package/src/createSuspenseQuery.ts +2 -2
  57. package/src/router.ts +10 -8
@@ -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._type) {\n acc[key] = buildRouter([...keys, key], opts)\n } else {\n const options: any = {\n ...opts,\n [opts._type === `m` ? `mutationKey` : `queryKey`]: [...keys, key],\n }\n\n acc[key] =\n opts._type === `m`\n ? {\n useMutation: createMutation(options),\n ...createMutation(options),\n }\n : opts._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\nrouter.query = <TFnData, TVariables = void, TError = CompatibleError>(\n options: RouterQueryOptions<TFnData, TVariables, TError>\n) => {\n return {\n ...options,\n _type: 'q',\n } as RouterQuery<TFnData, TVariables, TError>\n}\n\nrouter.infiniteQuery = <\n TFnData,\n TVariables = void,\n TError = CompatibleError,\n TPageParam = number\n>(\n options: RouterInfiniteQueryOptions<TFnData, TVariables, TError, TPageParam>\n) => {\n return { ...options, _type: 'inf' } as RouterInfiniteQuery<\n TFnData,\n TVariables,\n TError,\n TPageParam\n >\n}\n\nrouter.mutation = <\n TFnData = unknown,\n TVariables = void,\n TError = CompatibleError,\n TContext = unknown\n>(\n options: RouterMutationOptions<TFnData, TVariables, TError, TContext>\n) => {\n return { ...options, _type: 'm' } as RouterMutation<\n TFnData,\n TVariables,\n TError,\n TContext\n >\n}\n"],"names":["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":";;;;;;AAmBA,MAAMA,WAAW,GAAG,CAACC,IAAD,EAAiBC,MAAjB,KAA0C;AAC5D,EAAA,OAAOC,MAAM,CAACC,OAAP,CAAeF,MAAf,EAAuBG,MAAvB,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,CAACC,OAAN,CAAcjB,GAAd,CAAqBA,GAAAA,GAArB,GAA2B,CAACA,GAAD,CAA5B,EAAmCL,MAAnC,CAAlB,CAAA;AACD,EALM;;AAOPoB,MAAM,CAACG,KAAP,GACEf,OADa,IAEV;EACH,OAAO,EACL,GAAGA,OADE;AAELD,IAAAA,KAAK,EAAE,GAAA;GAFT,CAAA;AAID,CAPD,CAAA;;AASAa,MAAM,CAACI,aAAP,GAMEhB,OANqB,IAOlB;EACH,OAAO,EAAE,GAAGA,OAAL;AAAcD,IAAAA,KAAK,EAAE,KAAA;GAA5B,CAAA;AAMD,CAdD,CAAA;;AAgBAa,MAAM,CAACK,QAAP,GAMEjB,OANgB,IAOb;EACH,OAAO,EAAE,GAAGA,OAAL;AAAcD,IAAAA,KAAK,EAAE,GAAA;GAA5B,CAAA;AAMD,CAdD;;;;"}
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._type) {\n acc[key] = buildRouter([...keys, key], opts)\n } else {\n const options: any = {\n ...opts,\n [opts._type === `m` ? `mutationKey` : `queryKey`]: [...keys, key],\n }\n\n acc[key] =\n opts._type === `m`\n ? {\n useMutation: createMutation(options),\n ...createMutation(options),\n }\n : opts._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) {\n return {\n ...options,\n _type: 'q',\n } as RouterQuery<TFnData, TVariables, TError>\n}\n\nfunction infiniteQuery<\n TFnData,\n TVariables = void,\n TError = CompatibleError,\n TPageParam = number\n>(\n options: RouterInfiniteQueryOptions<TFnData, TVariables, TError, TPageParam>\n) {\n return { ...options, _type: '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>(options: RouterMutationOptions<TFnData, TVariables, TError, TContext>) {\n return { ...options, _type: '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":["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":";;;;;;AAmBA,MAAMA,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,CAACA,IAAI,CAACC,KAA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AA;AACD,EALM;;AAOP,SAASuB,KAAT,CACEf,OADF,EAEE;EACA,OAAO,EACL,GAAGA,OADE;AAELD,IAAAA,KAAK,EAAE,GAAA;GAFT,CAAA;AAID,CAAA;;AAED,SAASiB,aAAT,CAMEhB,OANF,EAOE;EACA,OAAO,EAAE,GAAGA,OAAL;AAAcD,IAAAA,KAAK,EAAE,KAAA;GAA5B,CAAA;AAMD,CAAA;;AAED,SAASkB,QAAT,CAKEjB,OALF,EAKyE;EACvE,OAAO,EAAE,GAAGA,OAAL;AAAcD,IAAAA,KAAK,EAAE,GAAA;GAA5B,CAAA;AAMD,CAAA;;AAEDa,MAAM,CAACG,KAAP,GAAeA,KAAf,CAAA;AACAH,MAAM,CAACI,aAAP,GAAuBA,aAAvB,CAAA;AACAJ,MAAM,CAACK,QAAP,GAAkBA,QAAlB;;;;"}
@@ -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":"ef45-1","name":"utils.ts"},{"uid":"ef45-3","name":"createBaseQuery.ts"},{"uid":"ef45-5","name":"createQuery.ts"},{"uid":"ef45-7","name":"createSuspenseQuery.ts"},{"uid":"ef45-9","name":"createInfiniteQuery.ts"},{"uid":"ef45-11","name":"createSuspenseInfiniteQuery.ts"},{"uid":"ef45-13","name":"createMutation.ts"},{"uid":"ef45-15","name":"router.ts"},{"uid":"ef45-17","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"ef45-1":{"renderedLength":868,"gzipLength":438,"brotliLength":0,"mainUid":"ef45-0"},"ef45-3":{"renderedLength":1225,"gzipLength":394,"brotliLength":0,"mainUid":"ef45-2"},"ef45-5":{"renderedLength":91,"gzipLength":87,"brotliLength":0,"mainUid":"ef45-4"},"ef45-7":{"renderedLength":179,"gzipLength":118,"brotliLength":0,"mainUid":"ef45-6"},"ef45-9":{"renderedLength":107,"gzipLength":97,"brotliLength":0,"mainUid":"ef45-8"},"ef45-11":{"renderedLength":203,"gzipLength":128,"brotliLength":0,"mainUid":"ef45-10"},"ef45-13":{"renderedLength":271,"gzipLength":168,"brotliLength":0,"mainUid":"ef45-12"},"ef45-15":{"renderedLength":1179,"gzipLength":403,"brotliLength":0,"mainUid":"ef45-14"},"ef45-17":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"ef45-16"}},"nodeMetas":{"ef45-0":{"id":"/src/utils.ts","moduleParts":{"zip.esm.js":"ef45-1"},"imported":[{"uid":"ef45-19"}],"importedBy":[{"uid":"ef45-16"},{"uid":"ef45-4"},{"uid":"ef45-6"},{"uid":"ef45-8"},{"uid":"ef45-10"},{"uid":"ef45-12"},{"uid":"ef45-2"}]},"ef45-2":{"id":"/src/createBaseQuery.ts","moduleParts":{"zip.esm.js":"ef45-3"},"imported":[{"uid":"ef45-0"}],"importedBy":[{"uid":"ef45-4"},{"uid":"ef45-6"},{"uid":"ef45-8"},{"uid":"ef45-10"}]},"ef45-4":{"id":"/src/createQuery.ts","moduleParts":{"zip.esm.js":"ef45-5"},"imported":[{"uid":"ef45-2"},{"uid":"ef45-0"}],"importedBy":[{"uid":"ef45-16"},{"uid":"ef45-14"}]},"ef45-6":{"id":"/src/createSuspenseQuery.ts","moduleParts":{"zip.esm.js":"ef45-7"},"imported":[{"uid":"ef45-2"},{"uid":"ef45-0"}],"importedBy":[{"uid":"ef45-16"},{"uid":"ef45-14"}]},"ef45-8":{"id":"/src/createInfiniteQuery.ts","moduleParts":{"zip.esm.js":"ef45-9"},"imported":[{"uid":"ef45-2"},{"uid":"ef45-0"}],"importedBy":[{"uid":"ef45-16"},{"uid":"ef45-14"}]},"ef45-10":{"id":"/src/createSuspenseInfiniteQuery.ts","moduleParts":{"zip.esm.js":"ef45-11"},"imported":[{"uid":"ef45-2"},{"uid":"ef45-0"}],"importedBy":[{"uid":"ef45-16"},{"uid":"ef45-14"}]},"ef45-12":{"id":"/src/createMutation.ts","moduleParts":{"zip.esm.js":"ef45-13"},"imported":[{"uid":"ef45-0"}],"importedBy":[{"uid":"ef45-16"},{"uid":"ef45-14"}]},"ef45-14":{"id":"/src/router.ts","moduleParts":{"zip.esm.js":"ef45-15"},"imported":[{"uid":"ef45-8"},{"uid":"ef45-12"},{"uid":"ef45-4"},{"uid":"ef45-10"},{"uid":"ef45-6"}],"importedBy":[{"uid":"ef45-16"}]},"ef45-16":{"id":"/src/index.ts","moduleParts":{"zip.esm.js":"ef45-17"},"imported":[{"uid":"ef45-4"},{"uid":"ef45-6"},{"uid":"ef45-8"},{"uid":"ef45-10"},{"uid":"ef45-12"},{"uid":"ef45-18"},{"uid":"ef45-14"},{"uid":"ef45-0"}],"importedBy":[],"isEntry":true},"ef45-18":{"id":"/src/types.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"ef45-16"}]},"ef45-19":{"id":"@tanstack/react-query","moduleParts":{},"imported":[],"importedBy":[{"uid":"ef45-0"}],"isExternal":true}},"env":{"rollup":"2.77.2"},"options":{"gzip":true,"brotli":false,"sourcemap":false}};
4017
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"zip.esm.js","children":[{"name":"src","children":[{"uid":"1db1-1","name":"utils.ts"},{"uid":"1db1-3","name":"createBaseQuery.ts"},{"uid":"1db1-5","name":"createQuery.ts"},{"uid":"1db1-7","name":"createSuspenseQuery.ts"},{"uid":"1db1-9","name":"createInfiniteQuery.ts"},{"uid":"1db1-11","name":"createSuspenseInfiniteQuery.ts"},{"uid":"1db1-13","name":"createMutation.ts"},{"uid":"1db1-15","name":"router.ts"},{"uid":"1db1-17","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"1db1-1":{"renderedLength":868,"gzipLength":438,"brotliLength":0,"mainUid":"1db1-0"},"1db1-3":{"renderedLength":1225,"gzipLength":394,"brotliLength":0,"mainUid":"1db1-2"},"1db1-5":{"renderedLength":89,"gzipLength":80,"brotliLength":0,"mainUid":"1db1-4"},"1db1-7":{"renderedLength":177,"gzipLength":111,"brotliLength":0,"mainUid":"1db1-6"},"1db1-9":{"renderedLength":105,"gzipLength":90,"brotliLength":0,"mainUid":"1db1-8"},"1db1-11":{"renderedLength":201,"gzipLength":121,"brotliLength":0,"mainUid":"1db1-10"},"1db1-13":{"renderedLength":269,"gzipLength":166,"brotliLength":0,"mainUid":"1db1-12"},"1db1-15":{"renderedLength":1259,"gzipLength":428,"brotliLength":0,"mainUid":"1db1-14"},"1db1-17":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"1db1-16"}},"nodeMetas":{"1db1-0":{"id":"/src/utils.ts","moduleParts":{"zip.esm.js":"1db1-1"},"imported":[{"uid":"1db1-19"}],"importedBy":[{"uid":"1db1-16"},{"uid":"1db1-4"},{"uid":"1db1-6"},{"uid":"1db1-8"},{"uid":"1db1-10"},{"uid":"1db1-12"},{"uid":"1db1-2"}]},"1db1-2":{"id":"/src/createBaseQuery.ts","moduleParts":{"zip.esm.js":"1db1-3"},"imported":[{"uid":"1db1-0"}],"importedBy":[{"uid":"1db1-4"},{"uid":"1db1-6"},{"uid":"1db1-8"},{"uid":"1db1-10"}]},"1db1-4":{"id":"/src/createQuery.ts","moduleParts":{"zip.esm.js":"1db1-5"},"imported":[{"uid":"1db1-2"},{"uid":"1db1-0"}],"importedBy":[{"uid":"1db1-16"},{"uid":"1db1-14"}]},"1db1-6":{"id":"/src/createSuspenseQuery.ts","moduleParts":{"zip.esm.js":"1db1-7"},"imported":[{"uid":"1db1-2"},{"uid":"1db1-0"}],"importedBy":[{"uid":"1db1-16"},{"uid":"1db1-14"}]},"1db1-8":{"id":"/src/createInfiniteQuery.ts","moduleParts":{"zip.esm.js":"1db1-9"},"imported":[{"uid":"1db1-2"},{"uid":"1db1-0"}],"importedBy":[{"uid":"1db1-16"},{"uid":"1db1-14"}]},"1db1-10":{"id":"/src/createSuspenseInfiniteQuery.ts","moduleParts":{"zip.esm.js":"1db1-11"},"imported":[{"uid":"1db1-2"},{"uid":"1db1-0"}],"importedBy":[{"uid":"1db1-16"},{"uid":"1db1-14"}]},"1db1-12":{"id":"/src/createMutation.ts","moduleParts":{"zip.esm.js":"1db1-13"},"imported":[{"uid":"1db1-0"}],"importedBy":[{"uid":"1db1-16"},{"uid":"1db1-14"}]},"1db1-14":{"id":"/src/router.ts","moduleParts":{"zip.esm.js":"1db1-15"},"imported":[{"uid":"1db1-8"},{"uid":"1db1-12"},{"uid":"1db1-4"},{"uid":"1db1-10"},{"uid":"1db1-6"}],"importedBy":[{"uid":"1db1-16"}]},"1db1-16":{"id":"/src/index.ts","moduleParts":{"zip.esm.js":"1db1-17"},"imported":[{"uid":"1db1-4"},{"uid":"1db1-6"},{"uid":"1db1-8"},{"uid":"1db1-10"},{"uid":"1db1-12"},{"uid":"1db1-18"},{"uid":"1db1-14"},{"uid":"1db1-0"}],"importedBy":[],"isEntry":true},"1db1-18":{"id":"/src/types.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"1db1-16"}]},"1db1-19":{"id":"@tanstack/react-query","moduleParts":{},"imported":[],"importedBy":[{"uid":"1db1-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;
package/build/stats.json CHANGED
@@ -10,39 +10,39 @@
10
10
  "name": "src",
11
11
  "children": [
12
12
  {
13
- "uid": "ef45-21",
13
+ "uid": "1db1-21",
14
14
  "name": "utils.ts"
15
15
  },
16
16
  {
17
- "uid": "ef45-23",
17
+ "uid": "1db1-23",
18
18
  "name": "createBaseQuery.ts"
19
19
  },
20
20
  {
21
- "uid": "ef45-25",
21
+ "uid": "1db1-25",
22
22
  "name": "createQuery.ts"
23
23
  },
24
24
  {
25
- "uid": "ef45-27",
25
+ "uid": "1db1-27",
26
26
  "name": "createSuspenseQuery.ts"
27
27
  },
28
28
  {
29
- "uid": "ef45-29",
29
+ "uid": "1db1-29",
30
30
  "name": "createInfiniteQuery.ts"
31
31
  },
32
32
  {
33
- "uid": "ef45-31",
33
+ "uid": "1db1-31",
34
34
  "name": "createSuspenseInfiniteQuery.ts"
35
35
  },
36
36
  {
37
- "uid": "ef45-33",
37
+ "uid": "1db1-33",
38
38
  "name": "createMutation.ts"
39
39
  },
40
40
  {
41
- "uid": "ef45-35",
41
+ "uid": "1db1-35",
42
42
  "name": "router.ts"
43
43
  },
44
44
  {
45
- "uid": "ef45-37",
45
+ "uid": "1db1-37",
46
46
  "name": "index.ts"
47
47
  }
48
48
  ]
@@ -53,307 +53,307 @@
53
53
  "isRoot": true
54
54
  },
55
55
  "nodeParts": {
56
- "ef45-21": {
56
+ "1db1-21": {
57
57
  "renderedLength": 868,
58
58
  "gzipLength": 438,
59
59
  "brotliLength": 0,
60
- "mainUid": "ef45-20"
60
+ "mainUid": "1db1-20"
61
61
  },
62
- "ef45-23": {
62
+ "1db1-23": {
63
63
  "renderedLength": 1225,
64
64
  "gzipLength": 394,
65
65
  "brotliLength": 0,
66
- "mainUid": "ef45-22"
66
+ "mainUid": "1db1-22"
67
67
  },
68
- "ef45-25": {
69
- "renderedLength": 91,
70
- "gzipLength": 87,
68
+ "1db1-25": {
69
+ "renderedLength": 89,
70
+ "gzipLength": 80,
71
71
  "brotliLength": 0,
72
- "mainUid": "ef45-24"
72
+ "mainUid": "1db1-24"
73
73
  },
74
- "ef45-27": {
75
- "renderedLength": 179,
76
- "gzipLength": 118,
74
+ "1db1-27": {
75
+ "renderedLength": 177,
76
+ "gzipLength": 111,
77
77
  "brotliLength": 0,
78
- "mainUid": "ef45-26"
78
+ "mainUid": "1db1-26"
79
79
  },
80
- "ef45-29": {
81
- "renderedLength": 107,
82
- "gzipLength": 97,
80
+ "1db1-29": {
81
+ "renderedLength": 105,
82
+ "gzipLength": 90,
83
83
  "brotliLength": 0,
84
- "mainUid": "ef45-28"
84
+ "mainUid": "1db1-28"
85
85
  },
86
- "ef45-31": {
87
- "renderedLength": 203,
88
- "gzipLength": 128,
86
+ "1db1-31": {
87
+ "renderedLength": 201,
88
+ "gzipLength": 121,
89
89
  "brotliLength": 0,
90
- "mainUid": "ef45-30"
90
+ "mainUid": "1db1-30"
91
91
  },
92
- "ef45-33": {
93
- "renderedLength": 271,
94
- "gzipLength": 168,
92
+ "1db1-33": {
93
+ "renderedLength": 269,
94
+ "gzipLength": 166,
95
95
  "brotliLength": 0,
96
- "mainUid": "ef45-32"
96
+ "mainUid": "1db1-32"
97
97
  },
98
- "ef45-35": {
99
- "renderedLength": 1179,
100
- "gzipLength": 403,
98
+ "1db1-35": {
99
+ "renderedLength": 1259,
100
+ "gzipLength": 428,
101
101
  "brotliLength": 0,
102
- "mainUid": "ef45-34"
102
+ "mainUid": "1db1-34"
103
103
  },
104
- "ef45-37": {
104
+ "1db1-37": {
105
105
  "renderedLength": 0,
106
106
  "gzipLength": 0,
107
107
  "brotliLength": 0,
108
- "mainUid": "ef45-36"
108
+ "mainUid": "1db1-36"
109
109
  }
110
110
  },
111
111
  "nodeMetas": {
112
- "ef45-20": {
112
+ "1db1-20": {
113
113
  "id": "/src/utils.ts",
114
114
  "moduleParts": {
115
- "zip.esm.js": "ef45-21"
115
+ "zip.esm.js": "1db1-21"
116
116
  },
117
117
  "imported": [
118
118
  {
119
- "uid": "ef45-39"
119
+ "uid": "1db1-39"
120
120
  }
121
121
  ],
122
122
  "importedBy": [
123
123
  {
124
- "uid": "ef45-36"
124
+ "uid": "1db1-36"
125
125
  },
126
126
  {
127
- "uid": "ef45-24"
127
+ "uid": "1db1-24"
128
128
  },
129
129
  {
130
- "uid": "ef45-26"
130
+ "uid": "1db1-26"
131
131
  },
132
132
  {
133
- "uid": "ef45-28"
133
+ "uid": "1db1-28"
134
134
  },
135
135
  {
136
- "uid": "ef45-30"
136
+ "uid": "1db1-30"
137
137
  },
138
138
  {
139
- "uid": "ef45-32"
139
+ "uid": "1db1-32"
140
140
  },
141
141
  {
142
- "uid": "ef45-22"
142
+ "uid": "1db1-22"
143
143
  }
144
144
  ]
145
145
  },
146
- "ef45-22": {
146
+ "1db1-22": {
147
147
  "id": "/src/createBaseQuery.ts",
148
148
  "moduleParts": {
149
- "zip.esm.js": "ef45-23"
149
+ "zip.esm.js": "1db1-23"
150
150
  },
151
151
  "imported": [
152
152
  {
153
- "uid": "ef45-20"
153
+ "uid": "1db1-20"
154
154
  }
155
155
  ],
156
156
  "importedBy": [
157
157
  {
158
- "uid": "ef45-24"
158
+ "uid": "1db1-24"
159
159
  },
160
160
  {
161
- "uid": "ef45-26"
161
+ "uid": "1db1-26"
162
162
  },
163
163
  {
164
- "uid": "ef45-28"
164
+ "uid": "1db1-28"
165
165
  },
166
166
  {
167
- "uid": "ef45-30"
167
+ "uid": "1db1-30"
168
168
  }
169
169
  ]
170
170
  },
171
- "ef45-24": {
171
+ "1db1-24": {
172
172
  "id": "/src/createQuery.ts",
173
173
  "moduleParts": {
174
- "zip.esm.js": "ef45-25"
174
+ "zip.esm.js": "1db1-25"
175
175
  },
176
176
  "imported": [
177
177
  {
178
- "uid": "ef45-22"
178
+ "uid": "1db1-22"
179
179
  },
180
180
  {
181
- "uid": "ef45-20"
181
+ "uid": "1db1-20"
182
182
  }
183
183
  ],
184
184
  "importedBy": [
185
185
  {
186
- "uid": "ef45-36"
186
+ "uid": "1db1-36"
187
187
  },
188
188
  {
189
- "uid": "ef45-34"
189
+ "uid": "1db1-34"
190
190
  }
191
191
  ]
192
192
  },
193
- "ef45-26": {
193
+ "1db1-26": {
194
194
  "id": "/src/createSuspenseQuery.ts",
195
195
  "moduleParts": {
196
- "zip.esm.js": "ef45-27"
196
+ "zip.esm.js": "1db1-27"
197
197
  },
198
198
  "imported": [
199
199
  {
200
- "uid": "ef45-22"
200
+ "uid": "1db1-22"
201
201
  },
202
202
  {
203
- "uid": "ef45-20"
203
+ "uid": "1db1-20"
204
204
  }
205
205
  ],
206
206
  "importedBy": [
207
207
  {
208
- "uid": "ef45-36"
208
+ "uid": "1db1-36"
209
209
  },
210
210
  {
211
- "uid": "ef45-34"
211
+ "uid": "1db1-34"
212
212
  }
213
213
  ]
214
214
  },
215
- "ef45-28": {
215
+ "1db1-28": {
216
216
  "id": "/src/createInfiniteQuery.ts",
217
217
  "moduleParts": {
218
- "zip.esm.js": "ef45-29"
218
+ "zip.esm.js": "1db1-29"
219
219
  },
220
220
  "imported": [
221
221
  {
222
- "uid": "ef45-22"
222
+ "uid": "1db1-22"
223
223
  },
224
224
  {
225
- "uid": "ef45-20"
225
+ "uid": "1db1-20"
226
226
  }
227
227
  ],
228
228
  "importedBy": [
229
229
  {
230
- "uid": "ef45-36"
230
+ "uid": "1db1-36"
231
231
  },
232
232
  {
233
- "uid": "ef45-34"
233
+ "uid": "1db1-34"
234
234
  }
235
235
  ]
236
236
  },
237
- "ef45-30": {
237
+ "1db1-30": {
238
238
  "id": "/src/createSuspenseInfiniteQuery.ts",
239
239
  "moduleParts": {
240
- "zip.esm.js": "ef45-31"
240
+ "zip.esm.js": "1db1-31"
241
241
  },
242
242
  "imported": [
243
243
  {
244
- "uid": "ef45-22"
244
+ "uid": "1db1-22"
245
245
  },
246
246
  {
247
- "uid": "ef45-20"
247
+ "uid": "1db1-20"
248
248
  }
249
249
  ],
250
250
  "importedBy": [
251
251
  {
252
- "uid": "ef45-36"
252
+ "uid": "1db1-36"
253
253
  },
254
254
  {
255
- "uid": "ef45-34"
255
+ "uid": "1db1-34"
256
256
  }
257
257
  ]
258
258
  },
259
- "ef45-32": {
259
+ "1db1-32": {
260
260
  "id": "/src/createMutation.ts",
261
261
  "moduleParts": {
262
- "zip.esm.js": "ef45-33"
262
+ "zip.esm.js": "1db1-33"
263
263
  },
264
264
  "imported": [
265
265
  {
266
- "uid": "ef45-20"
266
+ "uid": "1db1-20"
267
267
  }
268
268
  ],
269
269
  "importedBy": [
270
270
  {
271
- "uid": "ef45-36"
271
+ "uid": "1db1-36"
272
272
  },
273
273
  {
274
- "uid": "ef45-34"
274
+ "uid": "1db1-34"
275
275
  }
276
276
  ]
277
277
  },
278
- "ef45-34": {
278
+ "1db1-34": {
279
279
  "id": "/src/router.ts",
280
280
  "moduleParts": {
281
- "zip.esm.js": "ef45-35"
281
+ "zip.esm.js": "1db1-35"
282
282
  },
283
283
  "imported": [
284
284
  {
285
- "uid": "ef45-28"
285
+ "uid": "1db1-28"
286
286
  },
287
287
  {
288
- "uid": "ef45-32"
288
+ "uid": "1db1-32"
289
289
  },
290
290
  {
291
- "uid": "ef45-24"
291
+ "uid": "1db1-24"
292
292
  },
293
293
  {
294
- "uid": "ef45-30"
294
+ "uid": "1db1-30"
295
295
  },
296
296
  {
297
- "uid": "ef45-26"
297
+ "uid": "1db1-26"
298
298
  }
299
299
  ],
300
300
  "importedBy": [
301
301
  {
302
- "uid": "ef45-36"
302
+ "uid": "1db1-36"
303
303
  }
304
304
  ]
305
305
  },
306
- "ef45-36": {
306
+ "1db1-36": {
307
307
  "id": "/src/index.ts",
308
308
  "moduleParts": {
309
- "zip.esm.js": "ef45-37"
309
+ "zip.esm.js": "1db1-37"
310
310
  },
311
311
  "imported": [
312
312
  {
313
- "uid": "ef45-24"
313
+ "uid": "1db1-24"
314
314
  },
315
315
  {
316
- "uid": "ef45-26"
316
+ "uid": "1db1-26"
317
317
  },
318
318
  {
319
- "uid": "ef45-28"
319
+ "uid": "1db1-28"
320
320
  },
321
321
  {
322
- "uid": "ef45-30"
322
+ "uid": "1db1-30"
323
323
  },
324
324
  {
325
- "uid": "ef45-32"
325
+ "uid": "1db1-32"
326
326
  },
327
327
  {
328
- "uid": "ef45-38"
328
+ "uid": "1db1-38"
329
329
  },
330
330
  {
331
- "uid": "ef45-34"
331
+ "uid": "1db1-34"
332
332
  },
333
333
  {
334
- "uid": "ef45-20"
334
+ "uid": "1db1-20"
335
335
  }
336
336
  ],
337
337
  "importedBy": [],
338
338
  "isEntry": true
339
339
  },
340
- "ef45-38": {
340
+ "1db1-38": {
341
341
  "id": "/src/types.ts",
342
342
  "moduleParts": {},
343
343
  "imported": [],
344
344
  "importedBy": [
345
345
  {
346
- "uid": "ef45-36"
346
+ "uid": "1db1-36"
347
347
  }
348
348
  ]
349
349
  },
350
- "ef45-39": {
350
+ "1db1-39": {
351
351
  "id": "@tanstack/react-query",
352
352
  "moduleParts": {},
353
353
  "imported": [],
354
354
  "importedBy": [
355
355
  {
356
- "uid": "ef45-20"
356
+ "uid": "1db1-20"
357
357
  }
358
358
  ],
359
359
  "isExternal": true
@@ -100,29 +100,29 @@
100
100
  });
101
101
  };
102
102
 
103
- const createQuery = options => {
103
+ function createQuery(options) {
104
104
  return createBaseQuery(options, ReactQuery.useQuery);
105
- };
105
+ }
106
106
 
107
- const createSuspenseQuery = options => {
107
+ function createSuspenseQuery(options) {
108
108
  return isV5 ? createBaseQuery(options, ReactQuery.useSuspenseQuery) : createBaseQuery(options, ReactQuery.useQuery, suspenseOptions);
109
- };
109
+ }
110
110
 
111
- const createInfiniteQuery = options => {
111
+ function createInfiniteQuery(options) {
112
112
  return createBaseQuery(options, ReactQuery.useInfiniteQuery);
113
- };
113
+ }
114
114
 
115
- const createSuspenseInfiniteQuery = options => {
115
+ function createSuspenseInfiniteQuery(options) {
116
116
  return isV5 ? createBaseQuery(options, ReactQuery.useSuspenseInfiniteQuery) : createBaseQuery(options, ReactQuery.useInfiniteQuery, suspenseOptions);
117
- };
117
+ }
118
118
 
119
- const createMutation = defaultOptions => {
119
+ function createMutation(defaultOptions) {
120
120
  return Object.assign(withMiddleware(ReactQuery.useMutation, defaultOptions, 'mutations'), {
121
121
  getKey: () => defaultOptions.mutationKey,
122
122
  getOptions: () => defaultOptions,
123
123
  mutationFn: defaultOptions.mutationFn
124
124
  });
125
- };
125
+ }
126
126
 
127
127
  const buildRouter = (keys, config) => {
128
128
  return Object.entries(config).reduce((acc, [key, opts]) => {
@@ -156,23 +156,27 @@
156
156
  return buildRouter(Array.isArray(key) ? key : [key], config);
157
157
  };
158
158
 
159
- router.query = options => {
159
+ function query(options) {
160
160
  return { ...options,
161
161
  _type: 'q'
162
162
  };
163
- };
163
+ }
164
164
 
165
- router.infiniteQuery = options => {
165
+ function infiniteQuery(options) {
166
166
  return { ...options,
167
167
  _type: 'inf'
168
168
  };
169
- };
169
+ }
170
170
 
171
- router.mutation = options => {
171
+ function mutation(options) {
172
172
  return { ...options,
173
173
  _type: 'm'
174
174
  };
175
- };
175
+ }
176
+
177
+ router.query = query;
178
+ router.infiniteQuery = infiniteQuery;
179
+ router.mutation = mutation;
176
180
 
177
181
  exports.createInfiniteQuery = createInfiniteQuery;
178
182
  exports.createMutation = createMutation;