@ahoo-wang/fetcher-react 3.1.8 → 3.2.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/README.md +331 -5
- package/README.zh-CN.md +242 -355
- package/dist/core/useDebouncedExecutePromise.d.ts.map +1 -1
- package/dist/fetcher/useDebouncedFetcher.d.ts.map +1 -1
- package/dist/fetcher/useFetcher.d.ts.map +1 -1
- package/dist/index.es.js +277 -239
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/storage/index.d.ts +1 -0
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/useImmerKeyStorage.d.ts +4 -0
- package/dist/storage/useImmerKeyStorage.d.ts.map +1 -0
- package/dist/storage/useKeyStorage.d.ts +2 -29
- package/dist/storage/useKeyStorage.d.ts.map +1 -1
- package/dist/wow/debounce/useDebouncedQuery.d.ts.map +1 -1
- package/dist/wow/useCountQuery.d.ts.map +1 -1
- package/dist/wow/useListQuery.d.ts.map +1 -1
- package/dist/wow/useListStreamQuery.d.ts.map +1 -1
- package/dist/wow/usePagedQuery.d.ts.map +1 -1
- package/dist/wow/useQuery.d.ts.map +1 -1
- package/dist/wow/useSingleQuery.d.ts.map +1 -1
- package/package.json +6 -4
package/dist/index.es.js
CHANGED
|
@@ -1,465 +1,503 @@
|
|
|
1
1
|
var M = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
import { useRef as v, useCallback as
|
|
4
|
-
import { nameGenerator as
|
|
5
|
-
import {
|
|
2
|
+
var g = (e, t) => M(e, "name", { value: t, configurable: !0 });
|
|
3
|
+
import { useRef as v, useCallback as s, useEffect as F, useState as Q, useMemo as E, useReducer as O, useSyncExternalStore as q } from "react";
|
|
4
|
+
import { nameGenerator as k } from "@ahoo-wang/fetcher-eventbus";
|
|
5
|
+
import { produce as K } from "immer";
|
|
6
|
+
import { fetcherRegistrar as U, getFetcher as V } from "@ahoo-wang/fetcher";
|
|
6
7
|
function D() {
|
|
7
|
-
const e = v(!1), t =
|
|
8
|
+
const e = v(!1), t = s(() => e.current, []);
|
|
8
9
|
return F(() => (e.current = !0, () => {
|
|
9
10
|
e.current = !1;
|
|
10
11
|
}), []), t;
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
-
function
|
|
13
|
+
g(D, "useMounted");
|
|
14
|
+
function S(e) {
|
|
14
15
|
const t = v(e);
|
|
15
16
|
return t.current = e, t;
|
|
16
17
|
}
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
function
|
|
18
|
+
g(S, "useLatest");
|
|
19
|
+
var z = /* @__PURE__ */ ((e) => (e.IDLE = "idle", e.LOADING = "loading", e.SUCCESS = "success", e.ERROR = "error", e))(z || {});
|
|
20
|
+
function G(e) {
|
|
20
21
|
const [t, n] = Q(
|
|
21
22
|
e?.initialStatus ?? "idle"
|
|
22
23
|
/* IDLE */
|
|
23
|
-
), [
|
|
24
|
-
|
|
24
|
+
), [u, o] = Q(void 0), [l, i] = Q(void 0), r = D(), d = S(e), a = s(() => {
|
|
25
|
+
r() && (n(
|
|
25
26
|
"loading"
|
|
26
27
|
/* LOADING */
|
|
27
|
-
),
|
|
28
|
-
}, [
|
|
29
|
-
async (
|
|
30
|
-
if (
|
|
31
|
-
|
|
28
|
+
), i(void 0));
|
|
29
|
+
}, [r]), f = s(
|
|
30
|
+
async (m) => {
|
|
31
|
+
if (r()) {
|
|
32
|
+
o(m), n(
|
|
32
33
|
"success"
|
|
33
34
|
/* SUCCESS */
|
|
34
|
-
),
|
|
35
|
+
), i(void 0);
|
|
35
36
|
try {
|
|
36
|
-
await d.current?.onSuccess?.(
|
|
37
|
-
} catch (
|
|
38
|
-
console.warn("PromiseState onSuccess callback error:",
|
|
37
|
+
await d.current?.onSuccess?.(m);
|
|
38
|
+
} catch (y) {
|
|
39
|
+
console.warn("PromiseState onSuccess callback error:", y);
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
},
|
|
42
|
-
[
|
|
43
|
-
),
|
|
44
|
-
async (
|
|
45
|
-
if (
|
|
46
|
-
|
|
43
|
+
[r, d]
|
|
44
|
+
), c = s(
|
|
45
|
+
async (m) => {
|
|
46
|
+
if (r()) {
|
|
47
|
+
i(m), n(
|
|
47
48
|
"error"
|
|
48
49
|
/* ERROR */
|
|
49
|
-
),
|
|
50
|
+
), o(void 0);
|
|
50
51
|
try {
|
|
51
|
-
await d.current?.onError?.(
|
|
52
|
-
} catch (
|
|
53
|
-
console.warn("PromiseState onError callback error:",
|
|
52
|
+
await d.current?.onError?.(m);
|
|
53
|
+
} catch (y) {
|
|
54
|
+
console.warn("PromiseState onError callback error:", y);
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
57
|
},
|
|
57
|
-
[
|
|
58
|
-
),
|
|
59
|
-
|
|
58
|
+
[r, d]
|
|
59
|
+
), b = s(() => {
|
|
60
|
+
r() && (n(
|
|
60
61
|
"idle"
|
|
61
62
|
/* IDLE */
|
|
62
|
-
),
|
|
63
|
-
}, [
|
|
64
|
-
return
|
|
63
|
+
), i(void 0), o(void 0));
|
|
64
|
+
}, [r]);
|
|
65
|
+
return E(
|
|
65
66
|
() => ({
|
|
66
67
|
status: t,
|
|
67
68
|
loading: t === "loading",
|
|
68
|
-
result:
|
|
69
|
+
result: u,
|
|
69
70
|
error: l,
|
|
70
71
|
setLoading: a,
|
|
71
72
|
setSuccess: f,
|
|
72
|
-
setError:
|
|
73
|
-
setIdle:
|
|
73
|
+
setError: c,
|
|
74
|
+
setIdle: b
|
|
74
75
|
}),
|
|
75
|
-
[t,
|
|
76
|
+
[t, u, l, a, f, c, b]
|
|
76
77
|
);
|
|
77
78
|
}
|
|
78
|
-
|
|
79
|
+
g(G, "usePromiseState");
|
|
79
80
|
function T() {
|
|
80
|
-
const e = v(0), t =
|
|
81
|
+
const e = v(0), t = s(() => ++e.current, []), n = s(() => e.current, []), u = s((i) => i === e.current, []), o = s(() => {
|
|
81
82
|
e.current++;
|
|
82
|
-
}, []), l =
|
|
83
|
+
}, []), l = s(() => {
|
|
83
84
|
e.current = 0;
|
|
84
85
|
}, []);
|
|
85
|
-
return
|
|
86
|
+
return E(() => ({
|
|
86
87
|
generate: t,
|
|
87
88
|
current: n,
|
|
88
|
-
isLatest:
|
|
89
|
-
invalidate:
|
|
89
|
+
isLatest: u,
|
|
90
|
+
invalidate: o,
|
|
90
91
|
reset: l
|
|
91
|
-
}), [t, n,
|
|
92
|
+
}), [t, n, u, o, l]);
|
|
92
93
|
}
|
|
93
|
-
|
|
94
|
-
function
|
|
94
|
+
g(T, "useRequestId");
|
|
95
|
+
function p(e) {
|
|
95
96
|
const {
|
|
96
97
|
loading: t,
|
|
97
98
|
result: n,
|
|
98
|
-
error:
|
|
99
|
-
status:
|
|
99
|
+
error: u,
|
|
100
|
+
status: o,
|
|
100
101
|
setLoading: l,
|
|
101
|
-
setSuccess:
|
|
102
|
-
setError:
|
|
102
|
+
setSuccess: i,
|
|
103
|
+
setError: r,
|
|
103
104
|
setIdle: d
|
|
104
|
-
} =
|
|
105
|
+
} = G(e), a = D(), f = T(), c = v(void 0), b = e?.propagateError, m = e?.onAbort, y = s(async () => {
|
|
105
106
|
try {
|
|
106
|
-
await
|
|
107
|
+
await m?.();
|
|
107
108
|
} catch (w) {
|
|
108
109
|
console.warn("useExecutePromise onAbort callback error:", w);
|
|
109
110
|
}
|
|
110
|
-
}, [
|
|
111
|
+
}, [m]), C = s(
|
|
111
112
|
async (w) => {
|
|
112
|
-
|
|
113
|
+
c.current && (c.current.abort(), await y());
|
|
113
114
|
const I = new AbortController();
|
|
114
|
-
|
|
115
|
+
c.current = I;
|
|
115
116
|
const A = f.generate();
|
|
116
117
|
l();
|
|
117
118
|
try {
|
|
118
119
|
const R = await w(I);
|
|
119
|
-
a() && f.isLatest(A) && await
|
|
120
|
+
a() && f.isLatest(A) && await i(R);
|
|
120
121
|
} catch (R) {
|
|
121
122
|
if (R instanceof Error && R.name === "AbortError") {
|
|
122
123
|
a() && d();
|
|
123
124
|
return;
|
|
124
125
|
}
|
|
125
|
-
if (a() && f.isLatest(A) && await
|
|
126
|
+
if (a() && f.isLatest(A) && await r(R), b)
|
|
126
127
|
throw R;
|
|
127
128
|
} finally {
|
|
128
|
-
|
|
129
|
+
c.current === I && (c.current = void 0);
|
|
129
130
|
}
|
|
130
131
|
},
|
|
131
132
|
[
|
|
132
133
|
l,
|
|
133
|
-
|
|
134
|
-
|
|
134
|
+
i,
|
|
135
|
+
r,
|
|
135
136
|
d,
|
|
136
137
|
a,
|
|
137
138
|
f,
|
|
138
|
-
|
|
139
|
-
|
|
139
|
+
b,
|
|
140
|
+
y
|
|
140
141
|
]
|
|
141
|
-
),
|
|
142
|
+
), x = s(() => {
|
|
142
143
|
a() && d();
|
|
143
|
-
}, [d, a]),
|
|
144
|
-
|
|
145
|
-
}, [
|
|
144
|
+
}, [d, a]), h = s(async () => {
|
|
145
|
+
x(), c.current && (c.current.abort(), c.current = void 0, await y());
|
|
146
|
+
}, [x, y]);
|
|
146
147
|
return F(() => () => {
|
|
147
|
-
|
|
148
|
-
}, [
|
|
148
|
+
h();
|
|
149
|
+
}, [h]), E(
|
|
149
150
|
() => ({
|
|
150
151
|
loading: t,
|
|
151
152
|
result: n,
|
|
152
|
-
error:
|
|
153
|
-
status:
|
|
154
|
-
execute:
|
|
155
|
-
reset:
|
|
156
|
-
abort:
|
|
153
|
+
error: u,
|
|
154
|
+
status: o,
|
|
155
|
+
execute: C,
|
|
156
|
+
reset: x,
|
|
157
|
+
abort: h
|
|
157
158
|
}),
|
|
158
|
-
[t, n,
|
|
159
|
+
[t, n, u, o, C, x, h]
|
|
159
160
|
);
|
|
160
161
|
}
|
|
161
|
-
|
|
162
|
-
function
|
|
163
|
-
const e = v(/* @__PURE__ */ new Map()), t =
|
|
164
|
-
(
|
|
162
|
+
g(p, "useExecutePromise");
|
|
163
|
+
function Y() {
|
|
164
|
+
const e = v(/* @__PURE__ */ new Map()), t = s((c) => e.current.get(c), []), n = s(
|
|
165
|
+
(c, b) => e.current.set(c, b),
|
|
165
166
|
[]
|
|
166
|
-
),
|
|
167
|
-
|
|
167
|
+
), u = s((c) => e.current.has(c), []), o = s((c) => e.current.delete(c), []), l = s(() => e.current.clear(), []), i = s(() => e.current.keys(), []), r = s(() => e.current.values(), []), d = s(() => e.current.entries(), []), a = s(() => e.current[Symbol.iterator](), []), f = s((c) => (b) => {
|
|
168
|
+
b ? e.current.set(c, b) : e.current.delete(c);
|
|
168
169
|
}, []);
|
|
169
170
|
return F(() => () => {
|
|
170
171
|
e.current.clear();
|
|
171
|
-
}, []),
|
|
172
|
+
}, []), E(
|
|
172
173
|
() => ({
|
|
173
174
|
register: f,
|
|
174
175
|
get: t,
|
|
175
176
|
set: n,
|
|
176
|
-
has:
|
|
177
|
-
delete:
|
|
177
|
+
has: u,
|
|
178
|
+
delete: o,
|
|
178
179
|
clear: l,
|
|
179
|
-
keys:
|
|
180
|
-
values:
|
|
180
|
+
keys: i,
|
|
181
|
+
values: r,
|
|
181
182
|
entries: d,
|
|
182
183
|
get size() {
|
|
183
184
|
return e.current.size;
|
|
184
185
|
},
|
|
185
186
|
[Symbol.iterator]: a
|
|
186
187
|
}),
|
|
187
|
-
[f, t, n,
|
|
188
|
+
[f, t, n, u, o, l, i, r, d, a]
|
|
188
189
|
);
|
|
189
190
|
}
|
|
190
|
-
|
|
191
|
-
function
|
|
191
|
+
g(Y, "useRefs");
|
|
192
|
+
function P(e, t) {
|
|
192
193
|
if (t.leading === !1 && t.trailing === !1)
|
|
193
194
|
throw new Error(
|
|
194
195
|
"useDebouncedCallback: at least one of leading or trailing must be true"
|
|
195
196
|
);
|
|
196
197
|
const n = v(
|
|
197
198
|
void 0
|
|
198
|
-
),
|
|
199
|
+
), u = v(!1), o = S(e), l = S(t), i = s(() => n.current !== void 0, []), r = s(() => {
|
|
199
200
|
n.current !== void 0 && (clearTimeout(n.current), n.current = void 0);
|
|
200
201
|
}, []);
|
|
201
202
|
F(() => () => {
|
|
202
|
-
|
|
203
|
-
}, [
|
|
204
|
-
const d =
|
|
203
|
+
r();
|
|
204
|
+
}, [r]);
|
|
205
|
+
const d = s(
|
|
205
206
|
(...a) => {
|
|
206
|
-
const { leading: f = !1, trailing:
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
},
|
|
207
|
+
const { leading: f = !1, trailing: c = !0, delay: b } = l.current;
|
|
208
|
+
r(), f && !u.current && (o.current(...a), u.current = !0), c && (n.current = setTimeout(() => {
|
|
209
|
+
u.current || o.current(...a), u.current = !1, n.current = void 0;
|
|
210
|
+
}, b));
|
|
210
211
|
},
|
|
211
|
-
[
|
|
212
|
+
[o, l, r]
|
|
212
213
|
);
|
|
213
|
-
return
|
|
214
|
+
return E(
|
|
214
215
|
() => ({
|
|
215
216
|
run: d,
|
|
216
|
-
cancel:
|
|
217
|
-
isPending:
|
|
217
|
+
cancel: r,
|
|
218
|
+
isPending: i
|
|
218
219
|
}),
|
|
219
|
-
[d,
|
|
220
|
+
[d, r, i]
|
|
220
221
|
);
|
|
221
222
|
}
|
|
222
|
-
|
|
223
|
-
function
|
|
224
|
-
const { loading: t, result: n, error:
|
|
225
|
-
|
|
223
|
+
g(P, "useDebouncedCallback");
|
|
224
|
+
function Z(e) {
|
|
225
|
+
const { loading: t, result: n, error: u, execute: o, reset: l, abort: i, status: r } = p(e), { run: d, cancel: a, isPending: f } = P(
|
|
226
|
+
o,
|
|
226
227
|
e.debounce
|
|
227
228
|
);
|
|
228
|
-
return
|
|
229
|
+
return E(
|
|
229
230
|
() => ({
|
|
230
231
|
loading: t,
|
|
231
232
|
result: n,
|
|
232
|
-
error:
|
|
233
|
-
status:
|
|
233
|
+
error: u,
|
|
234
|
+
status: r,
|
|
234
235
|
reset: l,
|
|
235
|
-
abort:
|
|
236
|
+
abort: i,
|
|
236
237
|
run: d,
|
|
237
238
|
cancel: a,
|
|
238
239
|
isPending: f
|
|
239
240
|
}),
|
|
240
|
-
[t, n,
|
|
241
|
+
[t, n, u, r, l, i, d, a, f]
|
|
241
242
|
);
|
|
242
243
|
}
|
|
243
|
-
|
|
244
|
-
function
|
|
244
|
+
g(Z, "useDebouncedExecutePromise");
|
|
245
|
+
function _() {
|
|
245
246
|
const [, e] = O((t) => t + 1, 0);
|
|
246
247
|
return e;
|
|
247
248
|
}
|
|
248
|
-
|
|
249
|
-
function
|
|
250
|
-
const n =
|
|
251
|
-
(
|
|
252
|
-
name:
|
|
249
|
+
g(_, "useForceUpdate");
|
|
250
|
+
function N(e, t) {
|
|
251
|
+
const n = s(
|
|
252
|
+
(r) => e.addListener({
|
|
253
|
+
name: k.generate("useKeyStorage"),
|
|
253
254
|
// Generate unique listener name
|
|
254
|
-
handle:
|
|
255
|
+
handle: r
|
|
255
256
|
// Callback to trigger React re-render on storage changes
|
|
256
257
|
}),
|
|
257
258
|
[e]
|
|
258
259
|
// Recreate subscription only if keyStorage changes
|
|
259
|
-
),
|
|
260
|
-
const
|
|
261
|
-
return
|
|
262
|
-
}, [e, t]),
|
|
263
|
-
(
|
|
260
|
+
), u = s(() => {
|
|
261
|
+
const r = e.get();
|
|
262
|
+
return r !== null ? r : t ?? null;
|
|
263
|
+
}, [e, t]), o = q(n, u, u), l = s(
|
|
264
|
+
(r) => e.set(r),
|
|
264
265
|
[e]
|
|
265
266
|
// Recreate setter only if keyStorage changes
|
|
267
|
+
), i = s(
|
|
268
|
+
() => e.remove(),
|
|
269
|
+
[e]
|
|
270
|
+
// Recreate remover only if keyStorage changes
|
|
266
271
|
);
|
|
267
|
-
return [
|
|
272
|
+
return [o, l, i];
|
|
268
273
|
}
|
|
269
|
-
|
|
270
|
-
function
|
|
274
|
+
g(N, "useKeyStorage");
|
|
275
|
+
function $(e, t) {
|
|
276
|
+
const [n, u, o] = N(
|
|
277
|
+
e,
|
|
278
|
+
t
|
|
279
|
+
), l = s(
|
|
280
|
+
(i) => {
|
|
281
|
+
const r = K(n, i);
|
|
282
|
+
if (r === null) {
|
|
283
|
+
o();
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
return u(r);
|
|
287
|
+
},
|
|
288
|
+
[n, u, o]
|
|
289
|
+
);
|
|
290
|
+
return [n, l, o];
|
|
291
|
+
}
|
|
292
|
+
g($, "useImmerKeyStorage");
|
|
293
|
+
function j(e) {
|
|
271
294
|
const { fetcher: t = U.default } = e || {}, {
|
|
272
295
|
loading: n,
|
|
273
|
-
result:
|
|
274
|
-
error:
|
|
296
|
+
result: u,
|
|
297
|
+
error: o,
|
|
275
298
|
status: l,
|
|
276
|
-
execute:
|
|
277
|
-
reset:
|
|
299
|
+
execute: i,
|
|
300
|
+
reset: r,
|
|
278
301
|
abort: d
|
|
279
|
-
} =
|
|
302
|
+
} = p(e), [a, f] = Q(
|
|
280
303
|
void 0
|
|
281
|
-
),
|
|
282
|
-
async (
|
|
304
|
+
), c = S(e), b = V(t), m = s(
|
|
305
|
+
async (x) => {
|
|
283
306
|
try {
|
|
284
|
-
await
|
|
285
|
-
|
|
286
|
-
const w = await
|
|
287
|
-
|
|
288
|
-
|
|
307
|
+
await i(async (h) => {
|
|
308
|
+
x.abortController = h;
|
|
309
|
+
const w = await b.exchange(
|
|
310
|
+
x,
|
|
311
|
+
c.current
|
|
289
312
|
);
|
|
290
313
|
return f(w), await w.extractResult();
|
|
291
314
|
});
|
|
292
|
-
} catch (
|
|
293
|
-
throw f(void 0),
|
|
315
|
+
} catch (h) {
|
|
316
|
+
throw f(void 0), h;
|
|
294
317
|
}
|
|
295
318
|
},
|
|
296
|
-
[
|
|
297
|
-
),
|
|
298
|
-
|
|
299
|
-
}, [
|
|
319
|
+
[i, b, c]
|
|
320
|
+
), y = s(() => {
|
|
321
|
+
r(), f(void 0);
|
|
322
|
+
}, [r]), C = s(() => {
|
|
300
323
|
d(), f(void 0);
|
|
301
324
|
}, [d]);
|
|
302
|
-
return
|
|
325
|
+
return E(
|
|
303
326
|
() => ({
|
|
304
327
|
loading: n,
|
|
305
|
-
result:
|
|
306
|
-
error:
|
|
328
|
+
result: u,
|
|
329
|
+
error: o,
|
|
307
330
|
status: l,
|
|
308
331
|
exchange: a,
|
|
309
|
-
execute:
|
|
310
|
-
reset:
|
|
311
|
-
abort:
|
|
332
|
+
execute: m,
|
|
333
|
+
reset: y,
|
|
334
|
+
abort: C
|
|
312
335
|
}),
|
|
313
|
-
[n,
|
|
336
|
+
[n, u, o, l, a, m, y, C]
|
|
314
337
|
);
|
|
315
338
|
}
|
|
316
|
-
|
|
317
|
-
function
|
|
318
|
-
const { loading: t, result: n, error:
|
|
319
|
-
|
|
339
|
+
g(j, "useFetcher");
|
|
340
|
+
function ee(e) {
|
|
341
|
+
const { loading: t, result: n, error: u, status: o, exchange: l, execute: i, reset: r, abort: d } = j(e), { run: a, cancel: f, isPending: c } = P(
|
|
342
|
+
i,
|
|
320
343
|
e.debounce
|
|
321
344
|
);
|
|
322
|
-
return
|
|
345
|
+
return E(
|
|
323
346
|
() => ({
|
|
324
347
|
loading: t,
|
|
325
348
|
result: n,
|
|
326
|
-
error:
|
|
327
|
-
status:
|
|
349
|
+
error: u,
|
|
350
|
+
status: o,
|
|
328
351
|
exchange: l,
|
|
329
|
-
reset:
|
|
352
|
+
reset: r,
|
|
330
353
|
abort: d,
|
|
331
354
|
run: a,
|
|
332
355
|
cancel: f,
|
|
333
|
-
isPending:
|
|
356
|
+
isPending: c
|
|
334
357
|
}),
|
|
335
|
-
[
|
|
358
|
+
[
|
|
359
|
+
t,
|
|
360
|
+
n,
|
|
361
|
+
u,
|
|
362
|
+
o,
|
|
363
|
+
l,
|
|
364
|
+
r,
|
|
365
|
+
d,
|
|
366
|
+
a,
|
|
367
|
+
f,
|
|
368
|
+
c
|
|
369
|
+
]
|
|
336
370
|
);
|
|
337
371
|
}
|
|
338
|
-
|
|
372
|
+
g(ee, "useDebouncedFetcher");
|
|
339
373
|
function L(e) {
|
|
340
|
-
const t =
|
|
374
|
+
const t = S(e), {
|
|
341
375
|
loading: n,
|
|
342
|
-
result:
|
|
343
|
-
error:
|
|
376
|
+
result: u,
|
|
377
|
+
error: o,
|
|
344
378
|
status: l,
|
|
345
|
-
execute:
|
|
346
|
-
reset:
|
|
379
|
+
execute: i,
|
|
380
|
+
reset: r,
|
|
347
381
|
abort: d
|
|
348
|
-
} =
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
382
|
+
} = p(t.current), a = v(e.initialQuery), f = s(
|
|
383
|
+
async (y) => t.current.execute(
|
|
384
|
+
a.current,
|
|
385
|
+
t.current.attributes,
|
|
386
|
+
y
|
|
387
|
+
),
|
|
388
|
+
[a, t]
|
|
389
|
+
), c = s(() => i(f), [i, f]), b = s(() => a.current, [a]), m = s(
|
|
390
|
+
(y) => {
|
|
391
|
+
a.current = y, t.current.autoExecute && c();
|
|
355
392
|
},
|
|
356
|
-
[a, t,
|
|
393
|
+
[a, t, c]
|
|
357
394
|
);
|
|
358
395
|
return F(() => {
|
|
359
|
-
t.current.autoExecute &&
|
|
360
|
-
}, [t,
|
|
396
|
+
t.current.autoExecute && c();
|
|
397
|
+
}, [t, c]), E(
|
|
361
398
|
() => ({
|
|
362
399
|
loading: n,
|
|
363
|
-
result:
|
|
364
|
-
error:
|
|
400
|
+
result: u,
|
|
401
|
+
error: o,
|
|
365
402
|
status: l,
|
|
366
|
-
execute:
|
|
367
|
-
reset:
|
|
403
|
+
execute: c,
|
|
404
|
+
reset: r,
|
|
368
405
|
abort: d,
|
|
369
|
-
getQuery:
|
|
370
|
-
setQuery:
|
|
406
|
+
getQuery: b,
|
|
407
|
+
setQuery: m
|
|
371
408
|
}),
|
|
372
|
-
[
|
|
373
|
-
n,
|
|
374
|
-
o,
|
|
375
|
-
i,
|
|
376
|
-
l,
|
|
377
|
-
r,
|
|
378
|
-
u,
|
|
379
|
-
d,
|
|
380
|
-
g,
|
|
381
|
-
y
|
|
382
|
-
]
|
|
409
|
+
[n, u, o, l, c, r, d, b, m]
|
|
383
410
|
);
|
|
384
411
|
}
|
|
385
|
-
|
|
386
|
-
function
|
|
412
|
+
g(L, "useQuery");
|
|
413
|
+
function te(e) {
|
|
387
414
|
return L(e);
|
|
388
415
|
}
|
|
389
|
-
|
|
390
|
-
function
|
|
416
|
+
g(te, "usePagedQuery");
|
|
417
|
+
function re(e) {
|
|
391
418
|
return L(e);
|
|
392
419
|
}
|
|
393
|
-
|
|
394
|
-
function
|
|
420
|
+
g(re, "useSingleQuery");
|
|
421
|
+
function ne(e) {
|
|
395
422
|
return L(e);
|
|
396
423
|
}
|
|
397
|
-
|
|
398
|
-
function
|
|
424
|
+
g(ne, "useCountQuery");
|
|
425
|
+
function ce(e) {
|
|
399
426
|
return L(e);
|
|
400
427
|
}
|
|
401
|
-
|
|
402
|
-
function
|
|
428
|
+
g(ce, "useListQuery");
|
|
429
|
+
function se(e) {
|
|
403
430
|
return L(
|
|
404
431
|
e
|
|
405
432
|
);
|
|
406
433
|
}
|
|
407
|
-
|
|
408
|
-
function
|
|
409
|
-
const {
|
|
434
|
+
g(se, "useListStreamQuery");
|
|
435
|
+
function ue(e) {
|
|
436
|
+
const {
|
|
437
|
+
loading: t,
|
|
438
|
+
result: n,
|
|
439
|
+
error: u,
|
|
440
|
+
status: o,
|
|
441
|
+
execute: l,
|
|
442
|
+
reset: i,
|
|
443
|
+
abort: r,
|
|
444
|
+
getQuery: d,
|
|
445
|
+
setQuery: a
|
|
446
|
+
} = L(e), { run: f, cancel: c, isPending: b } = P(
|
|
410
447
|
l,
|
|
411
448
|
e.debounce
|
|
412
449
|
);
|
|
413
|
-
return
|
|
450
|
+
return E(
|
|
414
451
|
() => ({
|
|
415
452
|
loading: t,
|
|
416
453
|
result: n,
|
|
417
|
-
error:
|
|
418
|
-
status:
|
|
419
|
-
reset:
|
|
420
|
-
abort:
|
|
454
|
+
error: u,
|
|
455
|
+
status: o,
|
|
456
|
+
reset: i,
|
|
457
|
+
abort: r,
|
|
421
458
|
getQuery: d,
|
|
422
459
|
setQuery: a,
|
|
423
460
|
run: f,
|
|
424
|
-
cancel:
|
|
425
|
-
isPending:
|
|
461
|
+
cancel: c,
|
|
462
|
+
isPending: b
|
|
426
463
|
}),
|
|
427
464
|
[
|
|
428
465
|
t,
|
|
429
466
|
n,
|
|
467
|
+
u,
|
|
430
468
|
o,
|
|
431
469
|
i,
|
|
432
|
-
|
|
433
|
-
u,
|
|
470
|
+
r,
|
|
434
471
|
d,
|
|
435
472
|
a,
|
|
436
473
|
f,
|
|
437
|
-
|
|
438
|
-
|
|
474
|
+
c,
|
|
475
|
+
b
|
|
439
476
|
]
|
|
440
477
|
);
|
|
441
478
|
}
|
|
442
|
-
|
|
479
|
+
g(ue, "useDebouncedQuery");
|
|
443
480
|
export {
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
481
|
+
z as PromiseStatus,
|
|
482
|
+
ne as useCountQuery,
|
|
483
|
+
P as useDebouncedCallback,
|
|
484
|
+
Z as useDebouncedExecutePromise,
|
|
485
|
+
ee as useDebouncedFetcher,
|
|
486
|
+
ue as useDebouncedQuery,
|
|
487
|
+
p as useExecutePromise,
|
|
488
|
+
j as useFetcher,
|
|
489
|
+
_ as useForceUpdate,
|
|
490
|
+
$ as useImmerKeyStorage,
|
|
491
|
+
N as useKeyStorage,
|
|
492
|
+
S as useLatest,
|
|
493
|
+
ce as useListQuery,
|
|
494
|
+
se as useListStreamQuery,
|
|
457
495
|
D as useMounted,
|
|
458
|
-
|
|
459
|
-
|
|
496
|
+
te as usePagedQuery,
|
|
497
|
+
G as usePromiseState,
|
|
460
498
|
L as useQuery,
|
|
461
|
-
|
|
499
|
+
Y as useRefs,
|
|
462
500
|
T as useRequestId,
|
|
463
|
-
|
|
501
|
+
re as useSingleQuery
|
|
464
502
|
};
|
|
465
503
|
//# sourceMappingURL=index.es.js.map
|