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