@navios/react-query 0.6.0 → 0.7.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/CHANGELOG.md +41 -0
- package/README.md +142 -41
- package/dist/src/client/declare-client.d.mts.map +1 -1
- package/dist/src/client/types.d.mts +337 -113
- package/dist/src/client/types.d.mts.map +1 -1
- package/dist/src/mutation/make-hook.d.mts +3 -1
- package/dist/src/mutation/make-hook.d.mts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/lib/index.cjs +412 -0
- package/lib/index.cjs.map +1 -0
- package/lib/index.d.cts +961 -0
- package/lib/index.d.cts.map +1 -0
- package/lib/index.d.mts +961 -34
- package/lib/index.d.mts.map +1 -0
- package/lib/index.mjs +389 -350
- package/lib/index.mjs.map +1 -1
- package/package.json +4 -4
- package/project.json +2 -2
- package/src/__tests__/declare-client.spec.mts +2 -2
- package/src/__tests__/make-mutation.spec.mts +10 -9
- package/src/client/__type-tests__/client-instance.spec-d.mts +2 -2
- package/src/client/declare-client.mts +28 -6
- package/src/client/types.mts +617 -141
- package/src/mutation/make-hook.mts +3 -11
- package/{tsup.config.mts → tsdown.config.mts} +4 -3
- package/lib/_tsup-dts-rollup.d.mts +0 -873
- package/lib/_tsup-dts-rollup.d.ts +0 -873
- package/lib/index.d.ts +0 -34
- package/lib/index.js +0 -375
- package/lib/index.js.map +0 -1
|
@@ -56,7 +56,7 @@ export function makeMutation<
|
|
|
56
56
|
const result = (
|
|
57
57
|
keyParams: UseKey extends true
|
|
58
58
|
? UrlHasParams<Config['url']> extends true
|
|
59
|
-
? UrlParams<Config['url']>
|
|
59
|
+
? { urlParams: UrlParams<Config['url']> }
|
|
60
60
|
: never
|
|
61
61
|
: never,
|
|
62
62
|
): UseMutationResult<
|
|
@@ -83,18 +83,10 @@ export function makeMutation<
|
|
|
83
83
|
// @ts-expect-error The types match
|
|
84
84
|
return useMutation({
|
|
85
85
|
...rest,
|
|
86
|
-
mutationKey: useKey
|
|
87
|
-
? mutationKey({
|
|
88
|
-
urlParams: keyParams,
|
|
89
|
-
})
|
|
90
|
-
: undefined,
|
|
86
|
+
mutationKey: useKey ? mutationKey(keyParams) : undefined,
|
|
91
87
|
scope: useKey
|
|
92
88
|
? {
|
|
93
|
-
id: JSON.stringify(
|
|
94
|
-
mutationKey({
|
|
95
|
-
urlParams: keyParams,
|
|
96
|
-
}),
|
|
97
|
-
),
|
|
89
|
+
id: JSON.stringify(mutationKey(keyParams)),
|
|
98
90
|
}
|
|
99
91
|
: undefined,
|
|
100
92
|
async mutationFn(params: TVariables) {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { defineConfig } from '
|
|
1
|
+
import { defineConfig } from 'tsdown'
|
|
2
2
|
|
|
3
3
|
export default defineConfig({
|
|
4
4
|
entry: ['src/index.mts'],
|
|
5
5
|
outDir: 'lib',
|
|
6
6
|
format: ['esm', 'cjs'],
|
|
7
7
|
clean: true,
|
|
8
|
-
treeshake:
|
|
8
|
+
treeshake: true,
|
|
9
9
|
sourcemap: true,
|
|
10
10
|
platform: 'node',
|
|
11
|
-
|
|
11
|
+
dts: true,
|
|
12
|
+
target: 'es2022',
|
|
12
13
|
})
|