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