react-query-kit 3.2.1 → 3.3.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.
Files changed (67) hide show
  1. package/README.md +20 -2
  2. package/build/lib/createBaseQuery.d.ts +1 -1
  3. package/build/lib/createBaseQuery.esm.js +2 -2
  4. package/build/lib/createBaseQuery.esm.js.map +1 -1
  5. package/build/lib/createBaseQuery.js +1 -1
  6. package/build/lib/createBaseQuery.js.map +1 -1
  7. package/build/lib/createBaseQuery.mjs +2 -2
  8. package/build/lib/createBaseQuery.mjs.map +1 -1
  9. package/build/lib/createInfiniteQuery.d.ts +2 -2
  10. package/build/lib/createInfiniteQuery.esm.js +2 -2
  11. package/build/lib/createInfiniteQuery.esm.js.map +1 -1
  12. package/build/lib/createInfiniteQuery.js +2 -2
  13. package/build/lib/createInfiniteQuery.js.map +1 -1
  14. package/build/lib/createInfiniteQuery.mjs +2 -2
  15. package/build/lib/createInfiniteQuery.mjs.map +1 -1
  16. package/build/lib/createMutation.d.ts +2 -2
  17. package/build/lib/createMutation.esm.js +2 -2
  18. package/build/lib/createMutation.esm.js.map +1 -1
  19. package/build/lib/createMutation.js +2 -2
  20. package/build/lib/createMutation.js.map +1 -1
  21. package/build/lib/createMutation.mjs +2 -2
  22. package/build/lib/createMutation.mjs.map +1 -1
  23. package/build/lib/createQuery.d.ts +2 -2
  24. package/build/lib/createQuery.esm.js +2 -2
  25. package/build/lib/createQuery.esm.js.map +1 -1
  26. package/build/lib/createQuery.js +2 -2
  27. package/build/lib/createQuery.js.map +1 -1
  28. package/build/lib/createQuery.mjs +2 -2
  29. package/build/lib/createQuery.mjs.map +1 -1
  30. package/build/lib/createSuspenseInfiniteQuery.d.ts +2 -2
  31. package/build/lib/createSuspenseInfiniteQuery.esm.js +2 -2
  32. package/build/lib/createSuspenseInfiniteQuery.esm.js.map +1 -1
  33. package/build/lib/createSuspenseInfiniteQuery.js +2 -2
  34. package/build/lib/createSuspenseInfiniteQuery.js.map +1 -1
  35. package/build/lib/createSuspenseInfiniteQuery.mjs +2 -2
  36. package/build/lib/createSuspenseInfiniteQuery.mjs.map +1 -1
  37. package/build/lib/createSuspenseQuery.d.ts +2 -2
  38. package/build/lib/createSuspenseQuery.esm.js +2 -2
  39. package/build/lib/createSuspenseQuery.esm.js.map +1 -1
  40. package/build/lib/createSuspenseQuery.js +2 -2
  41. package/build/lib/createSuspenseQuery.js.map +1 -1
  42. package/build/lib/createSuspenseQuery.mjs +2 -2
  43. package/build/lib/createSuspenseQuery.mjs.map +1 -1
  44. package/build/lib/router.d.ts +8 -4
  45. package/build/lib/router.esm.js +10 -6
  46. package/build/lib/router.esm.js.map +1 -1
  47. package/build/lib/router.js +10 -6
  48. package/build/lib/router.js.map +1 -1
  49. package/build/lib/router.mjs +10 -6
  50. package/build/lib/router.mjs.map +1 -1
  51. package/build/lib/types.d.ts +7 -7
  52. package/build/stats-html.html +1 -1
  53. package/build/stats.json +112 -112
  54. package/build/umd/index.development.js +21 -17
  55. package/build/umd/index.development.js.map +1 -1
  56. package/build/umd/index.production.js +1 -1
  57. package/build/umd/index.production.js.map +1 -1
  58. package/package.json +2 -2
  59. package/src/createBaseQuery.ts +10 -7
  60. package/src/createInfiniteQuery.ts +2 -2
  61. package/src/createMutation.ts +2 -2
  62. package/src/createQuery.ts +2 -2
  63. package/src/createSuspenseInfiniteQuery.ts +2 -2
  64. package/src/createSuspenseQuery.ts +2 -2
  65. package/src/router.ts +10 -8
  66. package/src/types.ts +11 -6
  67. package/build/zip/zip.esm.js +0 -1
@@ -36,23 +36,27 @@ const router = (key, config) => {
36
36
  return buildRouter(Array.isArray(key) ? key : [key], config);
37
37
  };
38
38
 
39
- router.query = options => {
39
+ function query(options) {
40
40
  return { ...options,
41
41
  _type: 'q'
42
42
  };
43
- };
43
+ }
44
44
 
45
- router.infiniteQuery = options => {
45
+ function infiniteQuery(options) {
46
46
  return { ...options,
47
47
  _type: 'inf'
48
48
  };
49
- };
49
+ }
50
50
 
51
- router.mutation = options => {
51
+ function mutation(options) {
52
52
  return { ...options,
53
53
  _type: 'm'
54
54
  };
55
- };
55
+ }
56
+
57
+ router.query = query;
58
+ router.infiniteQuery = infiniteQuery;
59
+ router.mutation = mutation;
56
60
 
57
61
  export { router };
58
62
  //# sourceMappingURL=router.esm.js.map
@@ -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._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,CACL,CAACC,GAAD,EAAM,CAACC,GAAD,EAAMC,IAAN,CAAN,KAAsB;AACpB,IAAA,IAAI,CAACA,IAAI,CAACC,KAAV,EAAiB;AACfH,MAAAA,GAAG,CAACC,GAAD,CAAH,GAAWP,WAAW,CAAC,CAAC,GAAGC,IAAJ,EAAUM,GAAV,CAAD,EAAiBC,IAAjB,CAAtB,CAAA;AACD,KAFD,MAEO;AACL,MAAA,MAAME,OAAY,GAAG,EACnB,GAAGF,IADgB;QAEnB,CAACA,IAAI,CAACC,KAAL,KAAA,GAAA,GAAA,aAAA,GAAA,UAAD,GAAmD,CAAC,GAAGR,IAAJ,EAAUM,GAAV,CAAA;OAFrD,CAAA;AAKAD,MAAAA,GAAG,CAACC,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AGA,OAAL;AAAcD,IAAAA,KAAK,EAAE,GAAA;GAA5B,CAAA;AAMD,CAdD;;;;"}
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._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,KAAV,EAAiB;AACfH,MAAAA,GAAG,CAACC,GAAD,CAAH,GAAWP,WAAW,CAAC,CAAC,GAAGC,IAAJ,EAAUM,GAAV,CAAD,EAAiBC,IAAjB,CAAtB,CAAA;AACD,KAFD,MAEO;AACL,MAAA,MAAME,OAAY,GAAG,EACnB,GAAGF,IADgB;QAEnB,CAACA,IAAI,CAACC,KAAL,KAAA,GAAA,GAAA,aAAA,GAAA,UAAD,GAAmD,CAAC,GAAGR,IAAJ,EAAUM,GAAV,CAAA;OAFrD,CAAA;AAKAD,MAAAA,GAAG,CAACC,GAAD,CAAH,GACEC,IAAI,CAACC,KAAL,KACI,GAAA,GAAA;AACEE,QAAAA,WAAW,EAAEC,cAAc,CAACF,OAAD,CA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AP,GAAuBA,aAAvB,CAAA;AACAJ,MAAM,CAACK,QAAP,GAAkBA,QAAlB;;;;"}
@@ -40,23 +40,27 @@ const router = (key, config) => {
40
40
  return buildRouter(Array.isArray(key) ? key : [key], config);
41
41
  };
42
42
 
43
- router.query = options => {
43
+ function query(options) {
44
44
  return { ...options,
45
45
  _type: 'q'
46
46
  };
47
- };
47
+ }
48
48
 
49
- router.infiniteQuery = options => {
49
+ function infiniteQuery(options) {
50
50
  return { ...options,
51
51
  _type: 'inf'
52
52
  };
53
- };
53
+ }
54
54
 
55
- router.mutation = options => {
55
+ function mutation(options) {
56
56
  return { ...options,
57
57
  _type: 'm'
58
58
  };
59
- };
59
+ }
60
+
61
+ router.query = query;
62
+ router.infiniteQuery = infiniteQuery;
63
+ router.mutation = mutation;
60
64
 
61
65
  exports.router = router;
62
66
  //# sourceMappingURL=router.js.map
@@ -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._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,CACL,CAACC,GAAD,EAAM,CAACC,GAAD,EAAMC,IAAN,CAAN,KAAsB;AACpB,IAAA,IAAI,CAACA,IAAI,CAACC,KAAV,EAAiB;AAC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,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.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._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,KAAV,EAAiB;AACfH,MAAAA,GAAG,CAACC,GAAD,CAAH,GAAWP,WAAW,CAAC,CAAC,GAAGC,IAAJ,EAAUM,GAAV,CAAD,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E,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;;;;"}
@@ -36,23 +36,27 @@ const router = (key, config) => {
36
36
  return buildRouter(Array.isArray(key) ? key : [key], config);
37
37
  };
38
38
 
39
- router.query = options => {
39
+ function query(options) {
40
40
  return { ...options,
41
41
  _type: 'q'
42
42
  };
43
- };
43
+ }
44
44
 
45
- router.infiniteQuery = options => {
45
+ function infiniteQuery(options) {
46
46
  return { ...options,
47
47
  _type: 'inf'
48
48
  };
49
- };
49
+ }
50
50
 
51
- router.mutation = options => {
51
+ function mutation(options) {
52
52
  return { ...options,
53
53
  _type: 'm'
54
54
  };
55
- };
55
+ }
56
+
57
+ router.query = query;
58
+ router.infiniteQuery = infiniteQuery;
59
+ router.mutation = mutation;
56
60
 
57
61
  export { router };
58
62
  //# sourceMappingURL=router.mjs.map
@@ -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,CACL,CAACC,GAAD,EAAM,CAACC,GAAD,EAAMC,IAAN,CAAN,KAAsB;AACpB,IAAA,IAAI,CAACA,IAAI,CAACC,KAAV,EAAiB;AACfH,MAAAA,GAAG,CAACC,GAAD,CAAH,GAAWP,WAAW,CAAC,CAAC,GAAGC,IAAJ,EAAUM,GAAV,CAAD,EAAiBC,IAAjB,CAAtB,CAAA;AACD,KAFD,MAEO;AACL,MAAA,MAAME,OAAY,GAAG,EACnB,GAAGF,IADgB;QAEnB,CAACA,IAAI,CAACC,KAAL,KAAA,GAAA,GAAA,aAAA,GAAA,UAAD,GAAmD,CAAC,GAAGR,IAAJ,EAAUM,GAAV,CAAA;OAFrD,CAAA;AAKAD,MAAAA,GAAG,CAACC,GAAD,CAAH,GACEC,IAAI,CAACC,KAAL,KACI,GAAA,GAAA;AACEE,QAAAA,WAAW,EAAEC,cAAc,CAACF,OAAD,CAD7B;QAEE,GAAGE,cAAc,CAACF,OAAD,CAAA;AAFnB,OADJ,GAKIF,IAAI,CAACC,KAAL,KACA,GAAA,GAAA;AACEI,QAAAA,QAAQ,EAAEC,WAAW,CAACJ,OAAD,CADvB;AAEEK,QAAAA,gBAAgB,EAAEC,mBAAmB,CAACN,OAAD,CAFvC;QAGE,GAAGI,WAAW,CAACJ,OAAD,CAAA;AAHhB,OADA,GAMA;AACEO,QAAAA,gBAAgB,EAAEC,mBAAmB,CAACR,OAAD,CADvC;AAEES,QAAAA,wBAAwB,EAAEC,2BAA2B,CAACV,OAAD,CAFvD;QAGE,GAAGQ,mBAAmB,CAACR,OAAD,CAAA;OAf9B,CAAA;AAiBD,KAAA;;AAED,IAAA,OAAOJ,GAAP,CAAA;AACD,GA9BI,EA+BL;AACEe,IAAAA,MAAM,EAAE,MAAMpB,IAAAA;AADhB,GA/BK,CAAP,CAAA;AAmCD,CApCD,CAAA;;MAsCaqB,MAAM,GAAG,CACpBf,GADoB,EAEpBL,MAFoB,KAGM;AAC1B,EAAA,OAAOF,WAAW,CAACuB,KAAK,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":";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GA/BK,CAAP,CAAA;AAmCD,CApCD,CAAA;;MAsCaqB,MAAM,GAAG,CACpBf,GADoB,EAEpBL,MAFoB,KAGM;AAC1B,EAAA,OAAOF,WAAW,CAACuB,KAAK,CAACC,OAAN,CAAcjB,GAAd,CAAqBA,GAAAA,GAArB,GAA2B,CAACA,GAAD,CAA5B,EAAmCL,MAAnC,CAAlB,CAAA;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;;;;"}
@@ -1,4 +1,4 @@
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';
1
+ import type { DataTag, DefaultError, DefinedUseInfiniteQueryResult, DefinedUseQueryResult, InfiniteData, InfiniteQueryObserverSuccessResult, MutationFunction, 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 CompatibleUseInfiniteQueryOptions<TFnData, TData, TError, TPageParam> = CompatibleWithV4<UseInfiniteQueryOptions<TFnData, TError, TData, TFnData, QueryKey, TPageParam>, UseInfiniteQueryOptions<TFnData, TError, TData, TFnData, QueryKey>>;
4
4
  type CompatibleInfiniteData<TFnData, TPageParam> = CompatibleWithV4<InfiniteData<TFnData, TPageParam>, InfiniteData<TFnData>>;
@@ -24,10 +24,10 @@ export type ExposeMethods<TFnData, TVariables, TError, TPageParam = never> = {
24
24
  getKey: (variables?: DeepPartial<TVariables>) => CompatibleWithV4<DataTag<QueryKey, [
25
25
  TPageParam
26
26
  ] extends [never] ? TFnData : InfiniteData<TFnData, TPageParam>>, QueryKey>;
27
- getFetchOptions: (variables: TVariables extends void ? TVariables | void : TVariables) => Pick<ReturnType<ExposeMethods<TFnData, TVariables, TError, TPageParam>['getOptions']>, [
27
+ getFetchOptions: (variables: TVariables extends void ? CompatibleWithV4<TVariables | SkipToken, TVariables> | void : CompatibleWithV4<TVariables | SkipToken, TVariables>) => Pick<ReturnType<ExposeMethods<TFnData, TVariables, TError, TPageParam>['getOptions']>, [
28
28
  TPageParam
29
29
  ] extends [never] ? 'queryKey' | 'queryFn' | 'queryKeyHashFn' : 'queryKey' | 'queryFn' | 'queryKeyHashFn' | 'getNextPageParam' | 'getPreviousPageParam' | 'initialPageParam'>;
30
- getOptions: (variables: TVariables extends void ? TVariables | void : TVariables) => [TPageParam] extends [never] ? CompatibleWithV4<UseQueryOptions<TFnData, TError, TFnData, QueryKey> & {
30
+ getOptions: (variables: TVariables extends void ? CompatibleWithV4<TVariables | SkipToken, TVariables> | void : CompatibleWithV4<TVariables | SkipToken, TVariables>) => [TPageParam] extends [never] ? CompatibleWithV4<UseQueryOptions<TFnData, TError, TFnData, QueryKey> & {
31
31
  queryKey: DataTag<QueryKey, TFnData>;
32
32
  }, {
33
33
  queryKey: QueryKey;
@@ -45,7 +45,7 @@ export interface CreateQueryOptions<TFnData = unknown, TVariables = void, TError
45
45
  }
46
46
  export interface QueryHookOptions<TFnData, TError, TData, TVariables> extends Omit<UseQueryOptions<TFnData, TError, TData, QueryKey>, 'queryKey' | 'queryFn' | 'queryKeyHashFn'> {
47
47
  use?: Middleware<QueryHook<TFnData, TVariables, TError>>[];
48
- variables?: TVariables;
48
+ variables?: CompatibleWithV4<TVariables | SkipToken, TVariables>;
49
49
  }
50
50
  export interface DefinedQueryHookOptions<TFnData, TError, TData, TVariables> extends Omit<QueryHookOptions<TFnData, TError, TData, TVariables>, 'initialData'> {
51
51
  initialData: NonUndefinedGuard<TFnData> | (() => NonUndefinedGuard<TFnData>);
@@ -63,7 +63,7 @@ export interface CreateSuspenseQueryOptions<TFnData = unknown, TVariables = void
63
63
  }
64
64
  export interface SuspenseQueryHookOptions<TFnData, TError, TData, TVariables> extends Omit<UseQueryOptions<TFnData, TError, TData, QueryKey>, 'queryKey' | 'queryFn' | 'queryKeyHashFn' | 'enabled' | 'suspense' | 'throwOnError' | 'placeholderData' | 'keepPreviousData' | 'useErrorBoundary'> {
65
65
  use?: Middleware<SuspenseQueryHook<TFnData, TVariables, TVariables>>[];
66
- variables?: TVariables;
66
+ variables?: CompatibleWithV4<TVariables | SkipToken, TVariables>;
67
67
  }
68
68
  export type SuspenseQueryHookResult<TData, TError> = Omit<QueryObserverSuccessResult<TData, TError>, 'isPlaceholderData' | 'isPreviousData'>;
69
69
  export interface SuspenseQueryHook<TFnData = unknown, TVariables = void, TError = CompatibleError> extends ExposeMethods<TFnData, TVariables, TError> {
@@ -76,7 +76,7 @@ export interface CreateInfiniteQueryOptions<TFnData = unknown, TVariables = void
76
76
  }
77
77
  export interface InfiniteQueryHookOptions<TFnData, TError, TData, TVariables, TPageParam = number> extends Omit<CompatibleUseInfiniteQueryOptions<TFnData, TData, TError, TPageParam>, 'queryKey' | 'queryFn' | 'queryKeyHashFn' | 'initialPageParam' | 'getPreviousPageParam' | 'getNextPageParam'> {
78
78
  use?: Middleware<InfiniteQueryHook<TFnData, TVariables, TError, TPageParam>>[];
79
- variables?: TVariables;
79
+ variables?: CompatibleWithV4<TVariables | SkipToken, TVariables>;
80
80
  }
81
81
  export interface DefinedInfiniteQueryHookOptions<TFnData, TError, TData, TVariables, TPageParam = number> extends Omit<InfiniteQueryHookOptions<TFnData, TError, TData, TVariables, TPageParam>, 'initialData'> {
82
82
  initialData: NonUndefinedGuard<CompatibleInfiniteData<TFnData, TPageParam>> | (() => NonUndefinedGuard<CompatibleInfiniteData<TFnData, TPageParam>>);
@@ -94,7 +94,7 @@ export interface CreateSuspenseInfiniteQueryOptions<TFnData = unknown, TVariable
94
94
  }
95
95
  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'> {
96
96
  use?: Middleware<SuspenseInfiniteQueryHook<TFnData, TVariables, TVariables>>[];
97
- variables?: TVariables;
97
+ variables?: CompatibleWithV4<TVariables | SkipToken, TVariables>;
98
98
  }
99
99
  export type SuspenseInfiniteQueryHookResult<TData, TError> = Omit<InfiniteQueryObserverSuccessResult<TData, TError>, 'isPlaceholderData' | 'isPreviousData'>;
100
100
  export interface SuspenseInfiniteQueryHook<TFnData = unknown, TVariables = void, TError = CompatibleError, TPageParam = number> extends ExposeMethods<TFnData, TVariables, TError, TPageParam> {
@@ -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":"index.production.js","children":[{"name":"src","children":[{"uid":"130c-1","name":"utils.ts"},{"uid":"130c-3","name":"createBaseQuery.ts"},{"uid":"130c-5","name":"createQuery.ts"},{"uid":"130c-7","name":"createSuspenseQuery.ts"},{"uid":"130c-9","name":"createInfiniteQuery.ts"},{"uid":"130c-11","name":"createSuspenseInfiniteQuery.ts"},{"uid":"130c-13","name":"createMutation.ts"},{"uid":"130c-15","name":"router.ts"},{"uid":"130c-17","name":"index.ts"}]}]}],"isRoot":true},"nodeParts":{"130c-1":{"renderedLength":925,"gzipLength":457,"brotliLength":0,"mainUid":"130c-0"},"130c-3":{"renderedLength":1366,"gzipLength":424,"brotliLength":0,"mainUid":"130c-2"},"130c-5":{"renderedLength":95,"gzipLength":84,"brotliLength":0,"mainUid":"130c-4"},"130c-7":{"renderedLength":183,"gzipLength":115,"brotliLength":0,"mainUid":"130c-6"},"130c-9":{"renderedLength":111,"gzipLength":93,"brotliLength":0,"mainUid":"130c-8"},"130c-11":{"renderedLength":207,"gzipLength":125,"brotliLength":0,"mainUid":"130c-10"},"130c-13":{"renderedLength":283,"gzipLength":170,"brotliLength":0,"mainUid":"130c-12"},"130c-15":{"renderedLength":1353,"gzipLength":432,"brotliLength":0,"mainUid":"130c-14"},"130c-17":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"mainUid":"130c-16"}},"nodeMetas":{"130c-0":{"id":"/src/utils.ts","moduleParts":{"index.production.js":"130c-1"},"imported":[{"uid":"130c-19"}],"importedBy":[{"uid":"130c-16"},{"uid":"130c-4"},{"uid":"130c-6"},{"uid":"130c-8"},{"uid":"130c-10"},{"uid":"130c-12"},{"uid":"130c-2"}]},"130c-2":{"id":"/src/createBaseQuery.ts","moduleParts":{"index.production.js":"130c-3"},"imported":[{"uid":"130c-0"}],"importedBy":[{"uid":"130c-4"},{"uid":"130c-6"},{"uid":"130c-8"},{"uid":"130c-10"}]},"130c-4":{"id":"/src/createQuery.ts","moduleParts":{"index.production.js":"130c-5"},"imported":[{"uid":"130c-2"},{"uid":"130c-0"}],"importedBy":[{"uid":"130c-16"},{"uid":"130c-14"}]},"130c-6":{"id":"/src/createSuspenseQuery.ts","moduleParts":{"index.production.js":"130c-7"},"imported":[{"uid":"130c-2"},{"uid":"130c-0"}],"importedBy":[{"uid":"130c-16"},{"uid":"130c-14"}]},"130c-8":{"id":"/src/createInfiniteQuery.ts","moduleParts":{"index.production.js":"130c-9"},"imported":[{"uid":"130c-2"},{"uid":"130c-0"}],"importedBy":[{"uid":"130c-16"},{"uid":"130c-14"}]},"130c-10":{"id":"/src/createSuspenseInfiniteQuery.ts","moduleParts":{"index.production.js":"130c-11"},"imported":[{"uid":"130c-2"},{"uid":"130c-0"}],"importedBy":[{"uid":"130c-16"},{"uid":"130c-14"}]},"130c-12":{"id":"/src/createMutation.ts","moduleParts":{"index.production.js":"130c-13"},"imported":[{"uid":"130c-0"}],"importedBy":[{"uid":"130c-16"},{"uid":"130c-14"}]},"130c-14":{"id":"/src/router.ts","moduleParts":{"index.production.js":"130c-15"},"imported":[{"uid":"130c-8"},{"uid":"130c-12"},{"uid":"130c-4"},{"uid":"130c-10"},{"uid":"130c-6"}],"importedBy":[{"uid":"130c-16"}]},"130c-16":{"id":"/src/index.ts","moduleParts":{"index.production.js":"130c-17"},"imported":[{"uid":"130c-4"},{"uid":"130c-6"},{"uid":"130c-8"},{"uid":"130c-10"},{"uid":"130c-12"},{"uid":"130c-18"},{"uid":"130c-14"},{"uid":"130c-0"}],"importedBy":[],"isEntry":true},"130c-18":{"id":"/src/types.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"130c-16"}]},"130c-19":{"id":"@tanstack/react-query","moduleParts":{},"imported":[],"importedBy":[{"uid":"130c-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;