@studiolambda/query 1.3.0 → 1.5.4
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/query-CGIqlfYX.js +185 -0
- package/dist/query-CGIqlfYX.js.map +1 -0
- package/dist/query-Do4OvbxG.cjs +2 -0
- package/dist/query-Do4OvbxG.cjs.map +1 -0
- package/dist/query.cjs +1 -2
- package/dist/query.js +2 -169
- package/dist/query_react.cjs +6 -2
- package/dist/query_react.cjs.map +1 -1
- package/dist/query_react.js +255 -327
- package/dist/query_react.js.map +1 -1
- package/dist/src/query/options.d.ts +78 -4
- package/dist/src/react/components/QueryPrefetch.d.ts +31 -2
- package/dist/src/react/components/QueryPrefetchTags.d.ts +34 -1
- package/dist/src/react/components/QueryProvider.d.ts +30 -0
- package/dist/src/react/components/QueryTransition.d.ts +35 -0
- package/dist/src/react/context.d.ts +17 -0
- package/dist/src/react/hooks/useQuery.d.ts +44 -2
- package/dist/src/react/hooks/useQueryActions.d.ts +55 -1
- package/dist/src/react/hooks/useQueryBasic.d.ts +42 -2
- package/dist/src/react/hooks/useQueryContext.d.ts +13 -0
- package/dist/src/react/hooks/useQueryInstance.d.ts +27 -0
- package/dist/src/react/hooks/useQueryPrefetch.d.ts +15 -1
- package/dist/src/react/hooks/useQueryStatus.d.ts +40 -0
- package/dist/src/react/hooks/useQueryTransitionContext.d.ts +14 -0
- package/dist/src/react/transition.d.ts +17 -0
- package/package.json +60 -57
- package/dist/query.cjs.map +0 -1
- package/dist/query.js.map +0 -1
- package/dist/src/react/_internal.d.ts +0 -1
package/dist/query_react.js
CHANGED
|
@@ -1,341 +1,269 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { a as e, r as t, t as n } from "./query-CGIqlfYX.js";
|
|
2
|
+
import { createContext as r, use as i, useEffect as a, useEffectEvent as o, useState as s, useTransition as c } from "react";
|
|
3
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
4
|
+
//#region src/react/context.ts
|
|
5
|
+
var f = r({
|
|
6
|
+
query: void 0,
|
|
7
|
+
clearOnForget: void 0,
|
|
8
|
+
ignoreTransitionContext: void 0
|
|
8
9
|
});
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/react/hooks/useQueryContext.ts
|
|
12
|
+
function useQueryContext() {
|
|
13
|
+
return i(f);
|
|
11
14
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"No query instance was found. Please provide one via the resource options or the query context."
|
|
20
|
-
);
|
|
21
|
-
return o;
|
|
22
|
-
}
|
|
23
|
-
return s(e, [t, r]);
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/react/hooks/useQueryInstance.ts
|
|
17
|
+
var p = /* @__PURE__ */ Error("No query instance was found. Please provide one via the resource options or the query context.");
|
|
18
|
+
function useQueryInstance(e) {
|
|
19
|
+
let { query: t } = useQueryContext(), { query: n } = e ?? {}, r = n ?? t;
|
|
20
|
+
if (!r) throw p;
|
|
21
|
+
return r;
|
|
24
22
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
u,
|
|
51
|
-
i
|
|
52
|
-
]);
|
|
53
|
-
function T(f, y) {
|
|
54
|
-
return l(n, f, y);
|
|
55
|
-
}
|
|
56
|
-
const m = K(T, [l, n]);
|
|
57
|
-
async function Q() {
|
|
58
|
-
await c(n);
|
|
59
|
-
}
|
|
60
|
-
const h = K(Q, [c, n]);
|
|
61
|
-
function H() {
|
|
62
|
-
return { refetch: b, mutate: m, forget: h };
|
|
63
|
-
}
|
|
64
|
-
return s(H, [b, m, h]);
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/react/hooks/useQueryActions.ts
|
|
25
|
+
function useQueryActions(e, t) {
|
|
26
|
+
let { expiration: n, fetcher: r, stale: i, removeOnError: a, fresh: o } = t ?? {}, { query: s, mutate: c, forget: l } = useQueryInstance(t);
|
|
27
|
+
function refetch(t) {
|
|
28
|
+
return s(e, {
|
|
29
|
+
stale: i ?? !1,
|
|
30
|
+
expiration: n,
|
|
31
|
+
fetcher: r,
|
|
32
|
+
removeOnError: a,
|
|
33
|
+
fresh: o,
|
|
34
|
+
...t
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function localMutate(t, n) {
|
|
38
|
+
return c(e, t, n);
|
|
39
|
+
}
|
|
40
|
+
async function localForget() {
|
|
41
|
+
await l(e);
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
refetch,
|
|
45
|
+
mutate: localMutate,
|
|
46
|
+
forget: localForget
|
|
47
|
+
};
|
|
65
48
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
return s(Q, [o, i, l, g]);
|
|
49
|
+
//#endregion
|
|
50
|
+
//#region src/react/hooks/useQueryStatus.ts
|
|
51
|
+
function useQueryStatus(e, t) {
|
|
52
|
+
let { expiration: n, subscribe: r } = useQueryInstance(t), [i, o] = s(() => n(e) ?? /* @__PURE__ */ new Date()), [c, l] = s(() => Date.now() > i.getTime()), [u, d] = s(!1), [f, p] = s(!1);
|
|
53
|
+
return a(function() {
|
|
54
|
+
function handler() {
|
|
55
|
+
l(!0);
|
|
56
|
+
}
|
|
57
|
+
let e = setTimeout(handler, i.getTime() - Date.now());
|
|
58
|
+
return function() {
|
|
59
|
+
clearTimeout(e);
|
|
60
|
+
};
|
|
61
|
+
}, [i]), a(function() {
|
|
62
|
+
function onMutating() {
|
|
63
|
+
p(!0);
|
|
64
|
+
}
|
|
65
|
+
function onMutated() {
|
|
66
|
+
p(!1), o(n(e) ?? /* @__PURE__ */ new Date());
|
|
67
|
+
}
|
|
68
|
+
function onHydrated() {
|
|
69
|
+
o(n(e) ?? /* @__PURE__ */ new Date());
|
|
70
|
+
}
|
|
71
|
+
function onResolved() {
|
|
72
|
+
o(n(e) ?? /* @__PURE__ */ new Date()), d(!1);
|
|
73
|
+
}
|
|
74
|
+
function onForgotten() {
|
|
75
|
+
o(n(e) ?? /* @__PURE__ */ new Date());
|
|
76
|
+
}
|
|
77
|
+
function onRefetching() {
|
|
78
|
+
d(!0);
|
|
79
|
+
}
|
|
80
|
+
function onError() {
|
|
81
|
+
d(!1), p(!1);
|
|
82
|
+
}
|
|
83
|
+
let t = r(e, "mutating", onMutating), i = r(e, "mutated", onMutated), a = r(e, "hydrated", onHydrated), s = r(e, "resolved", onResolved), c = r(e, "forgotten", onForgotten), l = r(e, "refetching", onRefetching), u = r(e, "error", onError);
|
|
84
|
+
return function() {
|
|
85
|
+
t(), i(), a(), s(), c(), l(), u();
|
|
86
|
+
};
|
|
87
|
+
}, [
|
|
88
|
+
e,
|
|
89
|
+
r,
|
|
90
|
+
n
|
|
91
|
+
]), {
|
|
92
|
+
expiresAt: i,
|
|
93
|
+
isExpired: c,
|
|
94
|
+
isRefetching: u,
|
|
95
|
+
isMutating: f
|
|
96
|
+
};
|
|
116
97
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/react/transition.ts
|
|
100
|
+
var m = r({
|
|
101
|
+
isPending: void 0,
|
|
102
|
+
startTransition: void 0
|
|
120
103
|
});
|
|
121
|
-
|
|
122
|
-
|
|
104
|
+
//#endregion
|
|
105
|
+
//#region src/react/hooks/useQueryTransitionContext.ts
|
|
106
|
+
function useQueryTransitionContext() {
|
|
107
|
+
return i(m);
|
|
123
108
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
d(function() {
|
|
183
|
-
C(x.detail);
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
function Y(x) {
|
|
187
|
-
d(async function() {
|
|
188
|
-
const B = await x.detail;
|
|
189
|
-
d(function() {
|
|
190
|
-
C(B);
|
|
191
|
-
});
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
function Z(x) {
|
|
195
|
-
d(function() {
|
|
196
|
-
C(x.detail);
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
function _(x) {
|
|
200
|
-
d(function() {
|
|
201
|
-
C(x.detail);
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
function $(x) {
|
|
205
|
-
d(async function() {
|
|
206
|
-
const B = await x.detail;
|
|
207
|
-
d(function() {
|
|
208
|
-
C(B);
|
|
209
|
-
});
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
function k() {
|
|
213
|
-
F && d(async function() {
|
|
214
|
-
const x = await h(n, {
|
|
215
|
-
expiration: i,
|
|
216
|
-
fetcher: a,
|
|
217
|
-
stale: l,
|
|
218
|
-
removeOnError: c,
|
|
219
|
-
fresh: g
|
|
220
|
-
});
|
|
221
|
-
d(function() {
|
|
222
|
-
C(x);
|
|
223
|
-
});
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
|
-
const nn = f(n, "resolved", X), tn = f(n, "mutating", Y), en = f(n, "mutated", Z), rn = f(n, "hydrated", _), on = f(n, "refetching", $), un = f(n, "forgotten", k);
|
|
227
|
-
return function() {
|
|
228
|
-
nn(), tn(), en(), rn(), on(), un();
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
O(U, [
|
|
232
|
-
h,
|
|
233
|
-
H,
|
|
234
|
-
f,
|
|
235
|
-
n,
|
|
236
|
-
F,
|
|
237
|
-
i,
|
|
238
|
-
a,
|
|
239
|
-
l,
|
|
240
|
-
c,
|
|
241
|
-
g,
|
|
242
|
-
d
|
|
243
|
-
]);
|
|
244
|
-
function W() {
|
|
245
|
-
return { data: R, isPending: w };
|
|
246
|
-
}
|
|
247
|
-
return s(W, [R, w]);
|
|
109
|
+
//#endregion
|
|
110
|
+
//#region src/react/hooks/useQueryBasic.ts
|
|
111
|
+
function useQueryBasic(e, t) {
|
|
112
|
+
let { clearOnForget: n, ignoreTransitionContext: r } = useQueryContext(), { clearOnForget: l, ignoreTransitionContext: u, expiration: d, fetcher: f, stale: p, removeOnError: m, fresh: h } = t ?? {}, { isPending: g, startTransition: _ } = useQueryTransitionContext(), [v, y] = c(), { query: b, subscribe: x } = useQueryInstance(t), S = u ?? r ?? !1, C = S ? v : g ?? v, w = S ? y : _ ?? y, T = l ?? n ?? !1, [E, D] = s(i(b(e, {
|
|
113
|
+
expiration: d,
|
|
114
|
+
fetcher: f,
|
|
115
|
+
stale: p,
|
|
116
|
+
removeOnError: m,
|
|
117
|
+
fresh: h
|
|
118
|
+
}))), O = o(function(e) {
|
|
119
|
+
w(function() {
|
|
120
|
+
D(e.detail);
|
|
121
|
+
});
|
|
122
|
+
}), k = o(function(e) {
|
|
123
|
+
w(async function() {
|
|
124
|
+
let t = await e.detail;
|
|
125
|
+
w(function() {
|
|
126
|
+
D(t);
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
}), A = o(function(e) {
|
|
130
|
+
w(function() {
|
|
131
|
+
D(e.detail);
|
|
132
|
+
});
|
|
133
|
+
}), j = o(function(e) {
|
|
134
|
+
w(function() {
|
|
135
|
+
D(e.detail);
|
|
136
|
+
});
|
|
137
|
+
}), M = o(function(e) {
|
|
138
|
+
w(async function() {
|
|
139
|
+
let t = await e.detail;
|
|
140
|
+
w(function() {
|
|
141
|
+
D(t);
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
}), N = o(function() {
|
|
145
|
+
T && w(async function() {
|
|
146
|
+
let t = await b(e, {
|
|
147
|
+
expiration: d,
|
|
148
|
+
fetcher: f,
|
|
149
|
+
stale: p,
|
|
150
|
+
removeOnError: m,
|
|
151
|
+
fresh: h
|
|
152
|
+
});
|
|
153
|
+
w(function() {
|
|
154
|
+
D(t);
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
return a(function() {
|
|
159
|
+
let t = x(e, "resolved", O), n = x(e, "mutating", k), r = x(e, "mutated", A), i = x(e, "hydrated", j), a = x(e, "refetching", M), o = x(e, "forgotten", N);
|
|
160
|
+
return function() {
|
|
161
|
+
t(), n(), r(), i(), a(), o();
|
|
162
|
+
};
|
|
163
|
+
}, [e, x]), {
|
|
164
|
+
data: E,
|
|
165
|
+
isPending: C
|
|
166
|
+
};
|
|
248
167
|
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
168
|
+
//#endregion
|
|
169
|
+
//#region src/react/hooks/useQuery.ts
|
|
170
|
+
function useQuery(e, t) {
|
|
171
|
+
let n = useQueryBasic(e, t), r = useQueryActions(e, t), i = useQueryStatus(e, t);
|
|
172
|
+
return {
|
|
173
|
+
...n,
|
|
174
|
+
...r,
|
|
175
|
+
...i
|
|
176
|
+
};
|
|
256
177
|
}
|
|
257
|
-
|
|
258
|
-
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region src/react/hooks/useQueryPrefetch.ts
|
|
180
|
+
function useQueryPrefetch(e, t) {
|
|
181
|
+
let { query: n } = useQueryInstance(t);
|
|
182
|
+
a(function() {
|
|
183
|
+
for (let t of e) n(t);
|
|
184
|
+
}, [n, e]);
|
|
259
185
|
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
186
|
+
//#endregion
|
|
187
|
+
//#region node_modules/react/cjs/react-compiler-runtime.production.js
|
|
188
|
+
var h = /* @__PURE__ */ t(((t) => {
|
|
189
|
+
var n = e("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
190
|
+
t.c = function(e) {
|
|
191
|
+
return n.H.useMemoCache(e);
|
|
192
|
+
};
|
|
193
|
+
})), g = /* @__PURE__ */ t(((t) => {
|
|
194
|
+
process.env.NODE_ENV !== "production" && (function() {
|
|
195
|
+
var n = e("react").__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
196
|
+
t.c = function(e) {
|
|
197
|
+
var t = n.H;
|
|
198
|
+
return t === null && console.error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."), t.useMemoCache(e);
|
|
199
|
+
};
|
|
200
|
+
})();
|
|
201
|
+
})), _ = (/* @__PURE__ */ t(((e, t) => {
|
|
202
|
+
process.env.NODE_ENV === "production" ? t.exports = h() : t.exports = g();
|
|
203
|
+
})))();
|
|
204
|
+
function QueryProvider(e) {
|
|
205
|
+
let t = (0, _.c)(12), { children: r, clearOnForget: i, ignoreTransitionContext: o, query: s } = e, c;
|
|
206
|
+
t[0] === s ? c = t[1] : (c = s ?? n(), t[0] = s, t[1] = c);
|
|
207
|
+
let l = c, t2, d;
|
|
208
|
+
t[2] === l ? (t2 = t[3], d = t[4]) : (t2 = function() {
|
|
209
|
+
let e = new BroadcastChannel("query");
|
|
210
|
+
l.configure({ broadcast: e });
|
|
211
|
+
let t = l.subscribeBroadcast();
|
|
212
|
+
return function() {
|
|
213
|
+
t(), e.close();
|
|
214
|
+
};
|
|
215
|
+
}, d = [l], t[2] = l, t[3] = t2, t[4] = d), a(t2, d);
|
|
216
|
+
let p;
|
|
217
|
+
t[5] !== i || t[6] !== o || t[7] !== l ? (p = {
|
|
218
|
+
query: l,
|
|
219
|
+
clearOnForget: i,
|
|
220
|
+
ignoreTransitionContext: o
|
|
221
|
+
}, t[5] = i, t[6] = o, t[7] = l, t[8] = p) : p = t[8];
|
|
222
|
+
let m = p, h;
|
|
223
|
+
return t[9] !== r || t[10] !== m ? (h = /* @__PURE__ */ u(f, {
|
|
224
|
+
value: m,
|
|
225
|
+
children: r
|
|
226
|
+
}), t[9] = r, t[10] = m, t[11] = h) : h = t[11], h;
|
|
266
227
|
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
228
|
+
//#endregion
|
|
229
|
+
//#region src/react/components/QueryTransition.tsx
|
|
230
|
+
function QueryTransition(e) {
|
|
231
|
+
let t = (0, _.c)(6), { children: n, startTransition: r, isPending: i } = e, a;
|
|
232
|
+
t[0] !== i || t[1] !== r ? (a = {
|
|
233
|
+
startTransition: r,
|
|
234
|
+
isPending: i
|
|
235
|
+
}, t[0] = i, t[1] = r, t[2] = a) : a = t[2];
|
|
236
|
+
let o = a, s;
|
|
237
|
+
return t[3] !== n || t[4] !== o ? (s = /* @__PURE__ */ u(m, {
|
|
238
|
+
value: o,
|
|
239
|
+
children: n
|
|
240
|
+
}), t[3] = n, t[4] = o, t[5] = s) : s = t[5], s;
|
|
271
241
|
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
}) {
|
|
278
|
-
function o() {
|
|
279
|
-
return e ?? ln();
|
|
280
|
-
}
|
|
281
|
-
const u = s(o, [e]);
|
|
282
|
-
function i() {
|
|
283
|
-
if (u.broadcast()) {
|
|
284
|
-
const b = u.subscribeBroadcast();
|
|
285
|
-
return function() {
|
|
286
|
-
b();
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
const c = new BroadcastChannel("query");
|
|
290
|
-
u.configure({ broadcast: c });
|
|
291
|
-
const g = u.subscribeBroadcast();
|
|
292
|
-
return function() {
|
|
293
|
-
g(), c.close();
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
O(i, [u]);
|
|
297
|
-
function a() {
|
|
298
|
-
return { query: e, clearOnForget: r, ignoreTransitionContext: t };
|
|
299
|
-
}
|
|
300
|
-
const l = s(a, [e, r, t]);
|
|
301
|
-
return /* @__PURE__ */ j(N, { value: l, children: n });
|
|
242
|
+
//#endregion
|
|
243
|
+
//#region src/react/components/QueryPrefetch.tsx
|
|
244
|
+
function QueryPrefetch(e) {
|
|
245
|
+
let t = (0, _.c)(2), { keys: n, query: r, children: i } = e, a;
|
|
246
|
+
return t[0] === r ? a = t[1] : (a = { query: r }, t[0] = r, t[1] = a), useQueryPrefetch(n, a), i;
|
|
302
247
|
}
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
248
|
+
//#endregion
|
|
249
|
+
//#region src/react/components/QueryPrefetchTags.tsx
|
|
250
|
+
function QueryPrefetchTags(e) {
|
|
251
|
+
let t = (0, _.c)(12), n, r, i;
|
|
252
|
+
t[0] === e ? (n = t[1], r = t[2], i = t[3]) : ({keys: r, children: n, ...i} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i), useQueryPrefetch(r, i);
|
|
253
|
+
let a;
|
|
254
|
+
if (t[4] !== r || t[5] !== i) {
|
|
255
|
+
let t2;
|
|
256
|
+
t[7] === i ? t2 = t[8] : (t2 = (e) => /* @__PURE__ */ u("link", {
|
|
257
|
+
rel: "preload",
|
|
258
|
+
href: e,
|
|
259
|
+
as: "fetch",
|
|
260
|
+
...i
|
|
261
|
+
}, e), t[7] = i, t[8] = t2), a = r.map(t2), t[4] = r, t[5] = i, t[6] = a;
|
|
262
|
+
} else a = t[6];
|
|
263
|
+
let o = a, s;
|
|
264
|
+
return t[9] !== n || t[10] !== o ? (s = /* @__PURE__ */ d(l, { children: [o, n] }), t[9] = n, t[10] = o, t[11] = s) : s = t[11], s;
|
|
309
265
|
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
J(n, t);
|
|
315
|
-
const e = G(n);
|
|
316
|
-
function o() {
|
|
317
|
-
return e.map((i) => /* @__PURE__ */ j("link", { rel: "preload", href: i, as: "fetch", ...t }));
|
|
318
|
-
}
|
|
319
|
-
const u = s(o, [e, t]);
|
|
320
|
-
return /* @__PURE__ */ an(fn, { children: [
|
|
321
|
-
u,
|
|
322
|
-
r
|
|
323
|
-
] });
|
|
324
|
-
}
|
|
325
|
-
export {
|
|
326
|
-
N as Context,
|
|
327
|
-
Cn as QueryPrefetch,
|
|
328
|
-
yn as QueryPrefetchTags,
|
|
329
|
-
Tn as QueryProvider,
|
|
330
|
-
pn as QueryTransition,
|
|
331
|
-
z as TransitionContext,
|
|
332
|
-
Hn as useQuery,
|
|
333
|
-
dn as useQueryActions,
|
|
334
|
-
hn as useQueryBasic,
|
|
335
|
-
V as useQueryContext,
|
|
336
|
-
M as useQueryInstance,
|
|
337
|
-
J as useQueryPrefetch,
|
|
338
|
-
gn as useQueryStatus,
|
|
339
|
-
bn as useQueryTransitionContext
|
|
340
|
-
};
|
|
341
|
-
//# sourceMappingURL=query_react.js.map
|
|
266
|
+
//#endregion
|
|
267
|
+
export { f as Context, p as ErrNoQueryInstanceFound, QueryPrefetch, QueryPrefetchTags, QueryProvider, QueryTransition, m as TransitionContext, useQuery, useQueryActions, useQueryBasic, useQueryContext, useQueryInstance, useQueryPrefetch, useQueryStatus, useQueryTransitionContext };
|
|
268
|
+
|
|
269
|
+
//# sourceMappingURL=query_react.js.map
|