@studiolambda/query 1.4.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 -193
- package/dist/query_react.cjs +3 -19
- package/dist/query_react.cjs.map +1 -1
- package/dist/query_react.js +255 -418
- 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 +30 -1
- 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 +57 -59
- package/dist/query.cjs.map +0 -1
- package/dist/query.js.map +0 -1
package/dist/query_react.js
CHANGED
|
@@ -1,432 +1,269 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
ignoreTransitionContext: void 0
|
|
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
|
|
10
9
|
});
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/react/hooks/useQueryContext.ts
|
|
12
|
+
function useQueryContext() {
|
|
13
|
+
return i(f);
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
if (!n)
|
|
22
|
-
throw new Error(
|
|
23
|
-
"No query instance was found. Please provide one via the resource options or the query context."
|
|
24
|
-
);
|
|
25
|
-
return n;
|
|
26
|
-
},
|
|
27
|
-
[r, e]
|
|
28
|
-
);
|
|
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;
|
|
29
22
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
[a, t]
|
|
56
|
-
), d = P(
|
|
57
|
-
async function() {
|
|
58
|
-
await f(t);
|
|
59
|
-
},
|
|
60
|
-
[f, t]
|
|
61
|
-
);
|
|
62
|
-
return v(
|
|
63
|
-
function() {
|
|
64
|
-
return { refetch: l, mutate: m, forget: d };
|
|
65
|
-
},
|
|
66
|
-
[l, m, d]
|
|
67
|
-
);
|
|
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
|
+
};
|
|
68
48
|
}
|
|
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
|
-
|
|
116
|
-
|
|
117
|
-
Q(), g(), y(), S(), q(), x(), M();
|
|
118
|
-
};
|
|
119
|
-
},
|
|
120
|
-
[t, n, r, s]
|
|
121
|
-
), v(
|
|
122
|
-
function() {
|
|
123
|
-
return { expiresAt: o, isExpired: c, isRefetching: a, isMutating: l };
|
|
124
|
-
},
|
|
125
|
-
[o, c, a, l]
|
|
126
|
-
);
|
|
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
|
+
};
|
|
127
97
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
98
|
+
//#endregion
|
|
99
|
+
//#region src/react/transition.ts
|
|
100
|
+
var m = r({
|
|
101
|
+
isPending: void 0,
|
|
102
|
+
startTransition: void 0
|
|
132
103
|
});
|
|
133
|
-
|
|
134
|
-
|
|
104
|
+
//#endregion
|
|
105
|
+
//#region src/react/hooks/useQueryTransitionContext.ts
|
|
106
|
+
function useQueryTransitionContext() {
|
|
107
|
+
return i(m);
|
|
135
108
|
}
|
|
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
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}
|
|
195
|
-
i(K, "onMutating");
|
|
196
|
-
function X(p) {
|
|
197
|
-
g(function() {
|
|
198
|
-
x(p.detail);
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
i(X, "onMutated");
|
|
202
|
-
function Z(p) {
|
|
203
|
-
g(function() {
|
|
204
|
-
x(p.detail);
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
i(Z, "onHydrated");
|
|
208
|
-
function k(p) {
|
|
209
|
-
g(async function() {
|
|
210
|
-
const I = await p.detail;
|
|
211
|
-
g(function() {
|
|
212
|
-
x(I);
|
|
213
|
-
});
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
i(k, "onRefetching");
|
|
217
|
-
function ee() {
|
|
218
|
-
y && g(async function() {
|
|
219
|
-
const p = await T(t, {
|
|
220
|
-
expiration: c,
|
|
221
|
-
fetcher: u,
|
|
222
|
-
stale: a,
|
|
223
|
-
removeOnError: f,
|
|
224
|
-
fresh: l
|
|
225
|
-
});
|
|
226
|
-
g(function() {
|
|
227
|
-
x(p);
|
|
228
|
-
});
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
|
-
i(ee, "onForgotten");
|
|
232
|
-
const te = R(t, "resolved", M), ne = R(t, "mutating", K), re = R(t, "mutated", X), oe = R(t, "hydrated", Z), ie = R(t, "refetching", k), se = R(t, "forgotten", ee);
|
|
233
|
-
return function() {
|
|
234
|
-
te(), ne(), re(), oe(), ie(), se();
|
|
235
|
-
};
|
|
236
|
-
},
|
|
237
|
-
[
|
|
238
|
-
T,
|
|
239
|
-
D,
|
|
240
|
-
R,
|
|
241
|
-
t,
|
|
242
|
-
y,
|
|
243
|
-
c,
|
|
244
|
-
u,
|
|
245
|
-
a,
|
|
246
|
-
f,
|
|
247
|
-
l,
|
|
248
|
-
g
|
|
249
|
-
]
|
|
250
|
-
), v(
|
|
251
|
-
function() {
|
|
252
|
-
return { data: q, isPending: Q };
|
|
253
|
-
},
|
|
254
|
-
[q, Q]
|
|
255
|
-
);
|
|
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
|
+
};
|
|
256
167
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
);
|
|
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
|
+
};
|
|
267
177
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
r(n);
|
|
276
|
-
},
|
|
277
|
-
[r, t]
|
|
278
|
-
);
|
|
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]);
|
|
279
185
|
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
var
|
|
292
|
-
function
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
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;
|
|
299
227
|
}
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
return Y || (Y = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
314
|
-
var t = V.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
315
|
-
H.c = function(e) {
|
|
316
|
-
var r = t.H;
|
|
317
|
-
return r === null && console.error(
|
|
318
|
-
`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:
|
|
319
|
-
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
320
|
-
2. You might be breaking the Rules of Hooks
|
|
321
|
-
3. You might have more than one copy of React in the same app
|
|
322
|
-
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`
|
|
323
|
-
), r.useMemoCache(e);
|
|
324
|
-
};
|
|
325
|
-
})()), H;
|
|
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;
|
|
326
241
|
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
function
|
|
330
|
-
|
|
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;
|
|
331
247
|
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
function
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
});
|
|
350
|
-
const b = u.subscribeBroadcast();
|
|
351
|
-
return function() {
|
|
352
|
-
b(), h.close();
|
|
353
|
-
};
|
|
354
|
-
}, "t2"), f = [u], e[2] = u, e[3] = a, e[4] = f) : (a = e[3], f = e[4]), O(a, f);
|
|
355
|
-
let l;
|
|
356
|
-
e[5] !== n || e[6] !== o || e[7] !== u ? (l = {
|
|
357
|
-
query: u,
|
|
358
|
-
clearOnForget: n,
|
|
359
|
-
ignoreTransitionContext: o
|
|
360
|
-
}, e[5] = n, e[6] = o, e[7] = u, e[8] = l) : l = e[8];
|
|
361
|
-
const m = l;
|
|
362
|
-
let d;
|
|
363
|
-
return e[9] !== r || e[10] !== m ? (d = /* @__PURE__ */ U(G, { value: m, children: r }), e[9] = r, e[10] = m, e[11] = d) : d = e[11], d;
|
|
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;
|
|
364
265
|
}
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
startTransition: n,
|
|
370
|
-
isPending: o
|
|
371
|
-
} = t;
|
|
372
|
-
let s;
|
|
373
|
-
e[0] !== o || e[1] !== n ? (s = {
|
|
374
|
-
startTransition: n,
|
|
375
|
-
isPending: o
|
|
376
|
-
}, e[0] = o, e[1] = n, e[2] = s) : s = e[2];
|
|
377
|
-
const c = s;
|
|
378
|
-
let u;
|
|
379
|
-
return e[3] !== r || e[4] !== c ? (u = /* @__PURE__ */ U(z, { value: c, children: r }), e[3] = r, e[4] = c, e[5] = u) : u = e[5], u;
|
|
380
|
-
}
|
|
381
|
-
i(Oe, "QueryTransition");
|
|
382
|
-
function Qe(t) {
|
|
383
|
-
const e = F.c(2), {
|
|
384
|
-
keys: r,
|
|
385
|
-
query: n,
|
|
386
|
-
children: o
|
|
387
|
-
} = t;
|
|
388
|
-
let s;
|
|
389
|
-
return e[0] !== n ? (s = {
|
|
390
|
-
query: n
|
|
391
|
-
}, e[0] = n, e[1] = s) : s = e[1], J(r, s), o;
|
|
392
|
-
}
|
|
393
|
-
i(Qe, "QueryPrefetch");
|
|
394
|
-
function ye(t) {
|
|
395
|
-
const e = F.c(12);
|
|
396
|
-
let r, n, o;
|
|
397
|
-
e[0] !== t ? ({
|
|
398
|
-
keys: n,
|
|
399
|
-
children: r,
|
|
400
|
-
...o
|
|
401
|
-
} = t, e[0] = t, e[1] = r, e[2] = n, e[3] = o) : (r = e[1], n = e[2], o = e[3]), J(n, o);
|
|
402
|
-
let s;
|
|
403
|
-
if (e[4] !== n || e[5] !== o) {
|
|
404
|
-
let a;
|
|
405
|
-
e[7] !== o ? (a = /* @__PURE__ */ i((f) => /* @__PURE__ */ U("link", { rel: "preload", href: f, as: "fetch", ...o }), "t22"), e[7] = o, e[8] = a) : a = e[8], s = n.map(a), e[4] = n, e[5] = o, e[6] = s;
|
|
406
|
-
} else
|
|
407
|
-
s = e[6];
|
|
408
|
-
const c = s;
|
|
409
|
-
let u;
|
|
410
|
-
return e[9] !== r || e[10] !== c ? (u = /* @__PURE__ */ ae(fe, { children: [
|
|
411
|
-
c,
|
|
412
|
-
r
|
|
413
|
-
] }), e[9] = r, e[10] = c, e[11] = u) : u = e[11], u;
|
|
414
|
-
}
|
|
415
|
-
i(ye, "QueryPrefetchTags");
|
|
416
|
-
export {
|
|
417
|
-
G as Context,
|
|
418
|
-
Qe as QueryPrefetch,
|
|
419
|
-
ye as QueryPrefetchTags,
|
|
420
|
-
_e as QueryProvider,
|
|
421
|
-
Oe as QueryTransition,
|
|
422
|
-
z as TransitionContext,
|
|
423
|
-
Ee as useQuery,
|
|
424
|
-
de as useQueryActions,
|
|
425
|
-
ge as useQueryBasic,
|
|
426
|
-
W as useQueryContext,
|
|
427
|
-
w as useQueryInstance,
|
|
428
|
-
J as useQueryPrefetch,
|
|
429
|
-
he as useQueryStatus,
|
|
430
|
-
me as useQueryTransitionContext
|
|
431
|
-
};
|
|
432
|
-
//# 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
|