react-query-kit 1.3.7 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -51
- package/build/lib/createBaseQuery.d.ts +1 -6
- package/build/lib/createBaseQuery.esm.js +12 -6
- package/build/lib/createBaseQuery.esm.js.map +1 -1
- package/build/lib/createBaseQuery.js +12 -6
- package/build/lib/createBaseQuery.js.map +1 -1
- package/build/lib/createBaseQuery.mjs +12 -6
- package/build/lib/createBaseQuery.mjs.map +1 -1
- package/build/lib/createInfiniteQuery.d.ts +11 -5
- package/build/lib/createInfiniteQuery.esm.js +1 -3
- package/build/lib/createInfiniteQuery.esm.js.map +1 -1
- package/build/lib/createInfiniteQuery.js +1 -3
- package/build/lib/createInfiniteQuery.js.map +1 -1
- package/build/lib/createInfiniteQuery.mjs +1 -3
- package/build/lib/createInfiniteQuery.mjs.map +1 -1
- package/build/lib/createMutation.d.ts +7 -6
- package/build/lib/createMutation.esm.js +8 -6
- package/build/lib/createMutation.esm.js.map +1 -1
- package/build/lib/createMutation.js +7 -5
- package/build/lib/createMutation.js.map +1 -1
- package/build/lib/createMutation.mjs +8 -6
- package/build/lib/createMutation.mjs.map +1 -1
- package/build/lib/createQuery.d.ts +11 -5
- package/build/lib/createQuery.esm.js +1 -3
- package/build/lib/createQuery.esm.js.map +1 -1
- package/build/lib/createQuery.js +1 -3
- package/build/lib/createQuery.js.map +1 -1
- package/build/lib/createQuery.mjs +1 -3
- package/build/lib/createQuery.mjs.map +1 -1
- package/build/lib/index.d.ts +1 -1
- package/build/lib/types.d.ts +10 -9
- package/build/stats-html.html +1 -1
- package/build/stats.json +52 -83
- package/build/umd/index.development.js +21 -32
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +1 -1
- package/src/createBaseQuery.ts +15 -8
- package/src/createInfiniteQuery.ts +20 -31
- package/src/createMutation.ts +23 -71
- package/src/createQuery.tsx +25 -26
- package/src/index.ts +3 -0
- package/src/types.ts +64 -20
- package/build/lib/utils.d.ts +0 -2
- package/build/lib/utils.esm.js +0 -19
- package/build/lib/utils.esm.js.map +0 -1
- package/build/lib/utils.js +0 -23
- package/build/lib/utils.js.map +0 -1
- package/build/lib/utils.mjs +0 -19
- package/build/lib/utils.mjs.map +0 -1
- package/src/utils.ts +0 -17
package/build/lib/utils.mjs
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
function parseQueryKitArgs(arg1, arg2, arg3) {
|
|
2
|
-
if (typeof arg1 !== 'string') {
|
|
3
|
-
return arg1;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
if (typeof arg2 === 'function') {
|
|
7
|
-
return { ...arg3,
|
|
8
|
-
primaryKey: arg1,
|
|
9
|
-
queryFn: arg2
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return { ...arg2,
|
|
14
|
-
primaryKey: arg1
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { parseQueryKitArgs };
|
|
19
|
-
//# sourceMappingURL=utils.mjs.map
|
package/build/lib/utils.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.mjs","sources":["../../src/utils.ts"],"sourcesContent":["import type { QueryFunction } from '@tanstack/react-query'\n\nexport function parseQueryKitArgs<TOptions extends Record<any, any>>(\n arg1: string | TOptions,\n arg2?: QueryFunction<any, any> | TOptions,\n arg3?: TOptions\n): TOptions {\n if (typeof arg1 !== 'string') {\n return arg1 as TOptions\n }\n\n if (typeof arg2 === 'function') {\n return { ...arg3, primaryKey: arg1, queryFn: arg2 } as unknown as TOptions\n }\n\n return { ...arg2, primaryKey: arg1 } as unknown as TOptions\n}\n"],"names":["parseQueryKitArgs","arg1","arg2","arg3","primaryKey","queryFn"],"mappings":"AAEO,SAASA,iBAAT,CACLC,IADK,EAELC,IAFK,EAGLC,IAHK,EAIK;AACV,EAAA,IAAI,OAAOF,IAAP,KAAgB,QAApB,EAA8B;AAC5B,IAAA,OAAOA,IAAP,CAAA;AACD,GAAA;;AAED,EAAA,IAAI,OAAOC,IAAP,KAAgB,UAApB,EAAgC;IAC9B,OAAO,EAAE,GAAGC,IAAL;AAAWC,MAAAA,UAAU,EAAEH,IAAvB;AAA6BI,MAAAA,OAAO,EAAEH,IAAAA;KAA7C,CAAA;AACD,GAAA;;EAED,OAAO,EAAE,GAAGA,IAAL;AAAWE,IAAAA,UAAU,EAAEH,IAAAA;GAA9B,CAAA;AACD;;;;"}
|
package/src/utils.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { QueryFunction } from '@tanstack/react-query'
|
|
2
|
-
|
|
3
|
-
export function parseQueryKitArgs<TOptions extends Record<any, any>>(
|
|
4
|
-
arg1: string | TOptions,
|
|
5
|
-
arg2?: QueryFunction<any, any> | TOptions,
|
|
6
|
-
arg3?: TOptions
|
|
7
|
-
): TOptions {
|
|
8
|
-
if (typeof arg1 !== 'string') {
|
|
9
|
-
return arg1 as TOptions
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
if (typeof arg2 === 'function') {
|
|
13
|
-
return { ...arg3, primaryKey: arg1, queryFn: arg2 } as unknown as TOptions
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return { ...arg2, primaryKey: arg1 } as unknown as TOptions
|
|
17
|
-
}
|