@falcondev-oss/trpc-vue-query 0.5.0-rc.16 → 0.5.0-rc.17
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/dist/index.cjs +11 -10
- package/dist/index.mjs +11 -10
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -59,16 +59,17 @@ function createVueQueryProxyDecoration(name, trpc, queryClient) {
|
|
|
59
59
|
return trpc.query(joinedPath, firstArg, opts);
|
|
60
60
|
}
|
|
61
61
|
function createQuery(_input, { trpcOptions, queryOptions }, { type = "query" } = {}) {
|
|
62
|
-
const queryFn = (0, import_vue.computed)(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
62
|
+
const queryFn = (0, import_vue.computed)(
|
|
63
|
+
() => (0, import_core.toValue)(_input) === import_vue_query.skipToken ? import_vue_query.skipToken : async ({ signal }) => {
|
|
64
|
+
const input = (0, import_core.toValue)(_input);
|
|
65
|
+
const output = await trpc.query(joinedPath, input, {
|
|
66
|
+
signal,
|
|
67
|
+
...trpcOptions
|
|
68
|
+
});
|
|
69
|
+
if (type === "queries") return { output, input };
|
|
70
|
+
return output;
|
|
71
|
+
}
|
|
72
|
+
);
|
|
72
73
|
return (0, import_vue_query.queryOptions)({
|
|
73
74
|
queryKey: (0, import_vue.computed)(() => getQueryKey(path, (0, import_core.toValue)(_input), type)),
|
|
74
75
|
queryFn,
|
package/dist/index.mjs
CHANGED
|
@@ -44,16 +44,17 @@ function createVueQueryProxyDecoration(name, trpc, queryClient) {
|
|
|
44
44
|
return trpc.query(joinedPath, firstArg, opts);
|
|
45
45
|
}
|
|
46
46
|
function createQuery(_input, { trpcOptions, queryOptions }, { type = "query" } = {}) {
|
|
47
|
-
const queryFn = computed(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
const queryFn = computed(
|
|
48
|
+
() => toValue(_input) === skipToken ? skipToken : async ({ signal }) => {
|
|
49
|
+
const input = toValue(_input);
|
|
50
|
+
const output = await trpc.query(joinedPath, input, {
|
|
51
|
+
signal,
|
|
52
|
+
...trpcOptions
|
|
53
|
+
});
|
|
54
|
+
if (type === "queries") return { output, input };
|
|
55
|
+
return output;
|
|
56
|
+
}
|
|
57
|
+
);
|
|
57
58
|
return defineQueryOptions({
|
|
58
59
|
queryKey: computed(() => getQueryKey(path, toValue(_input), type)),
|
|
59
60
|
queryFn,
|
package/package.json
CHANGED