@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 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)(() => async ({ signal }) => {
63
- const input = (0, import_core.toValue)(_input);
64
- if (input === import_vue_query.skipToken) return import_vue_query.skipToken;
65
- const output = await trpc.query(joinedPath, input, {
66
- signal,
67
- ...trpcOptions
68
- });
69
- if (type === "queries") return { output, input };
70
- return output;
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(() => async ({ signal }) => {
48
- const input = toValue(_input);
49
- if (input === skipToken) return skipToken;
50
- const output = await trpc.query(joinedPath, input, {
51
- signal,
52
- ...trpcOptions
53
- });
54
- if (type === "queries") return { output, input };
55
- return output;
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@falcondev-oss/trpc-vue-query",
3
3
  "type": "module",
4
- "version": "0.5.0-rc.16",
4
+ "version": "0.5.0-rc.17",
5
5
  "description": "A tRPC wrapper around '@tanstack/vue-query'",
6
6
  "license": "MIT",
7
7
  "repository": "github:falcondev-oss/trpc-vue-query",