@ahoo-wang/fetcher-react 3.4.1 → 3.4.2
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 +306 -28
- package/README.zh-CN.md +291 -28
- package/dist/index.es.js +195 -162
- 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 +1 -0
- package/dist/wow/debounce/index.d.ts.map +1 -1
- package/dist/wow/debounce/useDebouncedFetcherQuery.d.ts +112 -0
- package/dist/wow/debounce/useDebouncedFetcherQuery.d.ts.map +1 -0
- package/dist/wow/debounce/useDebouncedQuery.d.ts +96 -24
- package/dist/wow/debounce/useDebouncedQuery.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var z = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
import { useRef as F, useEffect as L, useState as P, useCallback as g, useMemo as
|
|
2
|
+
var m = (r, e) => z(r, "name", { value: e, configurable: !0 });
|
|
3
|
+
import { useRef as F, useEffect as L, useState as P, useCallback as g, useMemo as D, useReducer as G, useSyncExternalStore as J } from "react";
|
|
4
4
|
import { c as _ } from "react/compiler-runtime";
|
|
5
5
|
import { nameGenerator as W } from "@ahoo-wang/fetcher-eventbus";
|
|
6
6
|
import { produce as N } from "immer";
|
|
@@ -9,35 +9,35 @@ import { JsonEventStreamResultExtractor as H } from "@ahoo-wang/fetcher-eventstr
|
|
|
9
9
|
function T() {
|
|
10
10
|
const r = _(3), e = F(!1);
|
|
11
11
|
let t;
|
|
12
|
-
r[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */
|
|
12
|
+
r[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ m(() => e.current, "t0"), r[0] = t) : t = r[0];
|
|
13
13
|
const n = t;
|
|
14
14
|
let c, s;
|
|
15
|
-
return r[1] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */
|
|
15
|
+
return r[1] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ m(() => (e.current = !0, () => {
|
|
16
16
|
e.current = !1;
|
|
17
17
|
}), "t1"), s = [], r[1] = c, r[2] = s) : (c = r[1], s = r[2]), L(c, s), n;
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
m(T, "useMounted");
|
|
20
20
|
function R(r) {
|
|
21
21
|
const e = F(r);
|
|
22
22
|
return e.current = r, e;
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
m(R, "useLatest");
|
|
25
25
|
var X = /* @__PURE__ */ ((r) => (r.IDLE = "idle", r.LOADING = "loading", r.SUCCESS = "success", r.ERROR = "error", r))(X || {});
|
|
26
26
|
function Y(r) {
|
|
27
27
|
const [e, t] = P(
|
|
28
28
|
r?.initialStatus ?? "idle"
|
|
29
29
|
/* IDLE */
|
|
30
|
-
), [n, c] = P(void 0), [s,
|
|
30
|
+
), [n, c] = P(void 0), [s, f] = P(void 0), l = T(), i = R(r), a = g(() => {
|
|
31
31
|
l() && (t(
|
|
32
32
|
"loading"
|
|
33
33
|
/* LOADING */
|
|
34
|
-
),
|
|
34
|
+
), f(void 0));
|
|
35
35
|
}, [l]), o = g(async (b) => {
|
|
36
36
|
if (l()) {
|
|
37
37
|
c(b), t(
|
|
38
38
|
"success"
|
|
39
39
|
/* SUCCESS */
|
|
40
|
-
),
|
|
40
|
+
), f(void 0);
|
|
41
41
|
try {
|
|
42
42
|
await i.current?.onSuccess?.(b);
|
|
43
43
|
} catch (y) {
|
|
@@ -46,7 +46,7 @@ function Y(r) {
|
|
|
46
46
|
}
|
|
47
47
|
}, [l, i]), u = g(async (b) => {
|
|
48
48
|
if (l()) {
|
|
49
|
-
|
|
49
|
+
f(b), t(
|
|
50
50
|
"error"
|
|
51
51
|
/* ERROR */
|
|
52
52
|
), c(void 0);
|
|
@@ -56,13 +56,13 @@ function Y(r) {
|
|
|
56
56
|
console.warn("PromiseState onError callback error:", y);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
}, [l, i]),
|
|
59
|
+
}, [l, i]), d = g(() => {
|
|
60
60
|
l() && (t(
|
|
61
61
|
"idle"
|
|
62
62
|
/* IDLE */
|
|
63
|
-
),
|
|
63
|
+
), f(void 0), c(void 0));
|
|
64
64
|
}, [l]);
|
|
65
|
-
return
|
|
65
|
+
return D(() => ({
|
|
66
66
|
status: e,
|
|
67
67
|
loading: e === "loading",
|
|
68
68
|
result: n,
|
|
@@ -70,52 +70,52 @@ function Y(r) {
|
|
|
70
70
|
setLoading: a,
|
|
71
71
|
setSuccess: o,
|
|
72
72
|
setError: u,
|
|
73
|
-
setIdle:
|
|
74
|
-
}), [e, n, s, a, o, u,
|
|
73
|
+
setIdle: d
|
|
74
|
+
}), [e, n, s, a, o, u, d]);
|
|
75
75
|
}
|
|
76
|
-
|
|
76
|
+
m(Y, "usePromiseState");
|
|
77
77
|
function Z() {
|
|
78
78
|
const r = _(6), e = F(0);
|
|
79
79
|
let t;
|
|
80
|
-
r[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */
|
|
80
|
+
r[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ m(() => e.current = e.current + 1, "t0"), r[0] = t) : t = r[0];
|
|
81
81
|
const n = t;
|
|
82
82
|
let c;
|
|
83
|
-
r[1] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */
|
|
83
|
+
r[1] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ m(() => e.current, "t1"), r[1] = c) : c = r[1];
|
|
84
84
|
const s = c;
|
|
85
|
-
let
|
|
86
|
-
r[2] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
87
|
-
const l =
|
|
85
|
+
let f;
|
|
86
|
+
r[2] === Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ m((b) => b === e.current, "t2"), r[2] = f) : f = r[2];
|
|
87
|
+
const l = f;
|
|
88
88
|
let i;
|
|
89
|
-
r[3] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */
|
|
89
|
+
r[3] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ m(() => {
|
|
90
90
|
e.current = e.current + 1;
|
|
91
91
|
}, "t3"), r[3] = i) : i = r[3];
|
|
92
92
|
const a = i;
|
|
93
93
|
let o;
|
|
94
|
-
r[4] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */
|
|
94
|
+
r[4] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ m(() => {
|
|
95
95
|
e.current = 0;
|
|
96
96
|
}, "t4"), r[4] = o) : o = r[4];
|
|
97
97
|
const u = o;
|
|
98
|
-
let
|
|
99
|
-
return r[5] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
98
|
+
let d;
|
|
99
|
+
return r[5] === Symbol.for("react.memo_cache_sentinel") ? (d = {
|
|
100
100
|
generate: n,
|
|
101
101
|
current: s,
|
|
102
102
|
isLatest: l,
|
|
103
103
|
invalidate: a,
|
|
104
104
|
reset: u
|
|
105
|
-
}, r[5] =
|
|
105
|
+
}, r[5] = d) : d = r[5], d;
|
|
106
106
|
}
|
|
107
|
-
|
|
108
|
-
function
|
|
107
|
+
m(Z, "useRequestId");
|
|
108
|
+
function q(r) {
|
|
109
109
|
const {
|
|
110
110
|
loading: e,
|
|
111
111
|
result: t,
|
|
112
112
|
error: n,
|
|
113
113
|
status: c,
|
|
114
114
|
setLoading: s,
|
|
115
|
-
setSuccess:
|
|
115
|
+
setSuccess: f,
|
|
116
116
|
setError: l,
|
|
117
117
|
setIdle: i
|
|
118
|
-
} = Y(r), a = T(), o = Z(), u = F(void 0),
|
|
118
|
+
} = Y(r), a = T(), o = Z(), u = F(void 0), d = r?.propagateError, b = r?.onAbort, y = g(async () => {
|
|
119
119
|
try {
|
|
120
120
|
await b?.();
|
|
121
121
|
} catch (S) {
|
|
@@ -129,25 +129,25 @@ function M(r) {
|
|
|
129
129
|
s();
|
|
130
130
|
try {
|
|
131
131
|
const v = await S(E);
|
|
132
|
-
a() && o.isLatest(w) && await
|
|
132
|
+
a() && o.isLatest(w) && await f(v);
|
|
133
133
|
} catch (v) {
|
|
134
134
|
if (v instanceof Error && v.name === "AbortError") {
|
|
135
135
|
a() && i();
|
|
136
136
|
return;
|
|
137
137
|
}
|
|
138
|
-
if (a() && o.isLatest(w) && await l(v),
|
|
138
|
+
if (a() && o.isLatest(w) && await l(v), d)
|
|
139
139
|
throw v;
|
|
140
140
|
} finally {
|
|
141
141
|
u.current === E && (u.current = void 0);
|
|
142
142
|
}
|
|
143
|
-
}, [s,
|
|
143
|
+
}, [s, f, l, i, a, o, d, y]), Q = g(() => {
|
|
144
144
|
a() && i();
|
|
145
145
|
}, [i, a]), x = g(async () => {
|
|
146
146
|
Q(), u.current && (u.current.abort(), u.current = void 0, await y());
|
|
147
147
|
}, [Q, y]);
|
|
148
148
|
return L(() => () => {
|
|
149
149
|
x();
|
|
150
|
-
}, [x]),
|
|
150
|
+
}, [x]), D(() => ({
|
|
151
151
|
loading: e,
|
|
152
152
|
result: t,
|
|
153
153
|
error: n,
|
|
@@ -157,58 +157,58 @@ function M(r) {
|
|
|
157
157
|
abort: x
|
|
158
158
|
}), [e, t, n, c, h, Q, x]);
|
|
159
159
|
}
|
|
160
|
-
|
|
160
|
+
m(q, "useExecutePromise");
|
|
161
161
|
function ie() {
|
|
162
|
-
const r = F(/* @__PURE__ */ new Map()), e = g((u) => r.current.get(u), []), t = g((u,
|
|
163
|
-
|
|
162
|
+
const r = F(/* @__PURE__ */ new Map()), e = g((u) => r.current.get(u), []), t = g((u, d) => r.current.set(u, d), []), n = g((u) => r.current.has(u), []), c = g((u) => r.current.delete(u), []), s = g(() => r.current.clear(), []), f = g(() => r.current.keys(), []), l = g(() => r.current.values(), []), i = g(() => r.current.entries(), []), a = g(() => r.current[Symbol.iterator](), []), o = g((u) => (d) => {
|
|
163
|
+
d ? r.current.set(u, d) : r.current.delete(u);
|
|
164
164
|
}, []);
|
|
165
165
|
return L(() => () => {
|
|
166
166
|
r.current.clear();
|
|
167
|
-
}, []),
|
|
167
|
+
}, []), D(() => ({
|
|
168
168
|
register: o,
|
|
169
169
|
get: e,
|
|
170
170
|
set: t,
|
|
171
171
|
has: n,
|
|
172
172
|
delete: c,
|
|
173
173
|
clear: s,
|
|
174
|
-
keys:
|
|
174
|
+
keys: f,
|
|
175
175
|
values: l,
|
|
176
176
|
entries: i,
|
|
177
177
|
get size() {
|
|
178
178
|
return r.current.size;
|
|
179
179
|
},
|
|
180
180
|
[Symbol.iterator]: a
|
|
181
|
-
}), [o, e, t, n, c, s,
|
|
181
|
+
}), [o, e, t, n, c, s, f, l, i, a]);
|
|
182
182
|
}
|
|
183
|
-
|
|
184
|
-
function
|
|
183
|
+
m(ie, "useRefs");
|
|
184
|
+
function A(r, e) {
|
|
185
185
|
const t = _(9);
|
|
186
186
|
if (e.leading === !1 && e.trailing === !1)
|
|
187
187
|
throw new Error("useDebouncedCallback: at least one of leading or trailing must be true");
|
|
188
|
-
const n = F(void 0), c = F(!1), s = R(r),
|
|
188
|
+
const n = F(void 0), c = F(!1), s = R(r), f = R(e);
|
|
189
189
|
let l;
|
|
190
|
-
t[0] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */
|
|
190
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ m(() => n.current !== void 0, "t0"), t[0] = l) : l = t[0];
|
|
191
191
|
const i = l;
|
|
192
192
|
let a;
|
|
193
|
-
t[1] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */
|
|
193
|
+
t[1] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ m(() => {
|
|
194
194
|
n.current !== void 0 && (clearTimeout(n.current), n.current = void 0);
|
|
195
195
|
}, "t1"), t[1] = a) : a = t[1];
|
|
196
196
|
const o = a;
|
|
197
|
-
let u,
|
|
198
|
-
t[2] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */
|
|
197
|
+
let u, d;
|
|
198
|
+
t[2] === Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ m(() => () => {
|
|
199
199
|
o();
|
|
200
|
-
}, "t2"),
|
|
200
|
+
}, "t2"), d = [o], t[2] = u, t[3] = d) : (u = t[2], d = t[3]), L(u, d);
|
|
201
201
|
let b;
|
|
202
|
-
t[4] !== s || t[5] !==
|
|
202
|
+
t[4] !== s || t[5] !== f ? (b = /* @__PURE__ */ m((...Q) => {
|
|
203
203
|
const x = Q, {
|
|
204
204
|
leading: S,
|
|
205
205
|
trailing: E,
|
|
206
206
|
delay: w
|
|
207
|
-
} =
|
|
208
|
-
o(), v && !c.current && (s.current(...x), c.current = !0),
|
|
207
|
+
} = f.current, v = S === void 0 ? !1 : S, $ = E === void 0 ? !0 : E;
|
|
208
|
+
o(), v && !c.current && (s.current(...x), c.current = !0), $ && (n.current = setTimeout(() => {
|
|
209
209
|
c.current || s.current(...x), c.current = !1, n.current = void 0;
|
|
210
210
|
}, w));
|
|
211
|
-
}, "t4"), t[4] = s, t[5] =
|
|
211
|
+
}, "t4"), t[4] = s, t[5] = f, t[6] = b) : b = t[6];
|
|
212
212
|
const y = b;
|
|
213
213
|
let h;
|
|
214
214
|
return t[7] !== y ? (h = {
|
|
@@ -217,84 +217,84 @@ function q(r, e) {
|
|
|
217
217
|
isPending: i
|
|
218
218
|
}, t[7] = y, t[8] = h) : h = t[8], h;
|
|
219
219
|
}
|
|
220
|
-
|
|
220
|
+
m(A, "useDebouncedCallback");
|
|
221
221
|
function ae(r) {
|
|
222
222
|
const e = _(10), {
|
|
223
223
|
loading: t,
|
|
224
224
|
result: n,
|
|
225
225
|
error: c,
|
|
226
226
|
execute: s,
|
|
227
|
-
reset:
|
|
227
|
+
reset: f,
|
|
228
228
|
abort: l,
|
|
229
229
|
status: i
|
|
230
|
-
} =
|
|
230
|
+
} = q(r), {
|
|
231
231
|
run: a,
|
|
232
232
|
cancel: o,
|
|
233
233
|
isPending: u
|
|
234
|
-
} =
|
|
235
|
-
let
|
|
236
|
-
return e[0] !== l || e[1] !== o || e[2] !== c || e[3] !== u || e[4] !== t || e[5] !==
|
|
234
|
+
} = A(s, r.debounce);
|
|
235
|
+
let d;
|
|
236
|
+
return e[0] !== l || e[1] !== o || e[2] !== c || e[3] !== u || e[4] !== t || e[5] !== f || e[6] !== n || e[7] !== a || e[8] !== i ? (d = {
|
|
237
237
|
loading: t,
|
|
238
238
|
result: n,
|
|
239
239
|
error: c,
|
|
240
240
|
status: i,
|
|
241
|
-
reset:
|
|
241
|
+
reset: f,
|
|
242
242
|
abort: l,
|
|
243
243
|
run: a,
|
|
244
244
|
cancel: o,
|
|
245
245
|
isPending: u
|
|
246
|
-
}, e[0] = l, e[1] = o, e[2] = c, e[3] = u, e[4] = t, e[5] =
|
|
246
|
+
}, e[0] = l, e[1] = o, e[2] = c, e[3] = u, e[4] = t, e[5] = f, e[6] = n, e[7] = a, e[8] = i, e[9] = d) : d = e[9], d;
|
|
247
247
|
}
|
|
248
|
-
|
|
248
|
+
m(ae, "useDebouncedExecutePromise");
|
|
249
249
|
function fe() {
|
|
250
250
|
const [, r] = G(ee, 0);
|
|
251
251
|
return r;
|
|
252
252
|
}
|
|
253
|
-
|
|
253
|
+
m(fe, "useForceUpdate");
|
|
254
254
|
function ee(r) {
|
|
255
255
|
return r + 1;
|
|
256
256
|
}
|
|
257
|
-
|
|
257
|
+
m(ee, "_temp");
|
|
258
258
|
function te(r, e) {
|
|
259
259
|
const t = _(13);
|
|
260
260
|
let n;
|
|
261
|
-
t[0] !== r ? (n = /* @__PURE__ */
|
|
261
|
+
t[0] !== r ? (n = /* @__PURE__ */ m((b) => r.addListener({
|
|
262
262
|
name: W.generate("useKeyStorage"),
|
|
263
263
|
handle: b
|
|
264
264
|
}), "t0"), t[0] = r, t[1] = n) : n = t[1];
|
|
265
265
|
const c = n;
|
|
266
266
|
let s;
|
|
267
|
-
t[2] !== e || t[3] !== r ? (s = /* @__PURE__ */
|
|
267
|
+
t[2] !== e || t[3] !== r ? (s = /* @__PURE__ */ m(() => {
|
|
268
268
|
const b = r.get();
|
|
269
269
|
return b !== null ? b : e ?? null;
|
|
270
270
|
}, "t1"), t[2] = e, t[3] = r, t[4] = s) : s = t[4];
|
|
271
|
-
const
|
|
271
|
+
const f = s, l = J(c, f, f);
|
|
272
272
|
let i;
|
|
273
|
-
t[5] !== r ? (i = /* @__PURE__ */
|
|
273
|
+
t[5] !== r ? (i = /* @__PURE__ */ m((b) => r.set(b), "t2"), t[5] = r, t[6] = i) : i = t[6];
|
|
274
274
|
const a = i;
|
|
275
275
|
let o;
|
|
276
|
-
t[7] !== r ? (o = /* @__PURE__ */
|
|
276
|
+
t[7] !== r ? (o = /* @__PURE__ */ m(() => r.remove(), "t3"), t[7] = r, t[8] = o) : o = t[8];
|
|
277
277
|
const u = o;
|
|
278
|
-
let
|
|
279
|
-
return t[9] !== u || t[10] !== a || t[11] !== l ? (
|
|
278
|
+
let d;
|
|
279
|
+
return t[9] !== u || t[10] !== a || t[11] !== l ? (d = [l, a, u], t[9] = u, t[10] = a, t[11] = l, t[12] = d) : d = t[12], d;
|
|
280
280
|
}
|
|
281
|
-
|
|
281
|
+
m(te, "useKeyStorage");
|
|
282
282
|
function de(r, e) {
|
|
283
283
|
const t = _(8), [n, c, s] = te(r, e);
|
|
284
|
-
let
|
|
285
|
-
t[0] !== s || t[1] !== c || t[2] !== n ? (
|
|
284
|
+
let f;
|
|
285
|
+
t[0] !== s || t[1] !== c || t[2] !== n ? (f = /* @__PURE__ */ m((a) => {
|
|
286
286
|
const o = N(n, a);
|
|
287
287
|
if (o === null) {
|
|
288
288
|
s();
|
|
289
289
|
return;
|
|
290
290
|
}
|
|
291
291
|
return c(o);
|
|
292
|
-
}, "t0"), t[0] = s, t[1] = c, t[2] = n, t[3] =
|
|
293
|
-
const l =
|
|
292
|
+
}, "t0"), t[0] = s, t[1] = c, t[2] = n, t[3] = f) : f = t[3];
|
|
293
|
+
const l = f;
|
|
294
294
|
let i;
|
|
295
295
|
return t[4] !== s || t[5] !== l || t[6] !== n ? (i = [n, l, s], t[4] = s, t[5] = l, t[6] = n, t[7] = i) : i = t[7], i;
|
|
296
296
|
}
|
|
297
|
-
|
|
297
|
+
m(de, "useImmerKeyStorage");
|
|
298
298
|
function U(r) {
|
|
299
299
|
const e = _(21);
|
|
300
300
|
let t;
|
|
@@ -303,143 +303,143 @@ function U(r) {
|
|
|
303
303
|
fetcher: n
|
|
304
304
|
} = t, c = n === void 0 ? j.default : n, {
|
|
305
305
|
loading: s,
|
|
306
|
-
result:
|
|
306
|
+
result: f,
|
|
307
307
|
error: l,
|
|
308
308
|
status: i,
|
|
309
309
|
execute: a,
|
|
310
310
|
reset: o,
|
|
311
311
|
abort: u
|
|
312
|
-
} =
|
|
312
|
+
} = q(r), [d, b] = P(void 0), y = R(r);
|
|
313
313
|
let h;
|
|
314
314
|
e[2] !== c ? (h = k(c), e[2] = c, e[3] = h) : h = e[3];
|
|
315
315
|
const Q = h;
|
|
316
316
|
let x;
|
|
317
|
-
e[4] !== Q || e[5] !== y || e[6] !== a ? (x = /* @__PURE__ */
|
|
317
|
+
e[4] !== Q || e[5] !== y || e[6] !== a ? (x = /* @__PURE__ */ m(async (K) => {
|
|
318
318
|
try {
|
|
319
|
-
await a(async (
|
|
320
|
-
K.abortController =
|
|
319
|
+
await a(async (M) => {
|
|
320
|
+
K.abortController = M;
|
|
321
321
|
const I = await Q.exchange(K, y.current);
|
|
322
322
|
return b(I), await I.extractResult();
|
|
323
323
|
});
|
|
324
|
-
} catch (
|
|
325
|
-
const I =
|
|
324
|
+
} catch (M) {
|
|
325
|
+
const I = M;
|
|
326
326
|
throw b(void 0), I;
|
|
327
327
|
}
|
|
328
328
|
}, "t3"), e[4] = Q, e[5] = y, e[6] = a, e[7] = x) : x = e[7];
|
|
329
329
|
const S = x;
|
|
330
330
|
let E;
|
|
331
|
-
e[8] !== o ? (E = /* @__PURE__ */
|
|
331
|
+
e[8] !== o ? (E = /* @__PURE__ */ m(() => {
|
|
332
332
|
o(), b(void 0);
|
|
333
333
|
}, "t4"), e[8] = o, e[9] = E) : E = e[9];
|
|
334
334
|
const w = E;
|
|
335
335
|
let v;
|
|
336
|
-
e[10] !== u ? (v = /* @__PURE__ */
|
|
336
|
+
e[10] !== u ? (v = /* @__PURE__ */ m(() => {
|
|
337
337
|
u(), b(void 0);
|
|
338
338
|
}, "t5"), e[10] = u, e[11] = v) : v = e[11];
|
|
339
|
-
const
|
|
340
|
-
let
|
|
341
|
-
return e[12] !==
|
|
339
|
+
const $ = v;
|
|
340
|
+
let O;
|
|
341
|
+
return e[12] !== $ || e[13] !== l || e[14] !== d || e[15] !== S || e[16] !== s || e[17] !== w || e[18] !== f || e[19] !== i ? (O = {
|
|
342
342
|
loading: s,
|
|
343
|
-
result:
|
|
343
|
+
result: f,
|
|
344
344
|
error: l,
|
|
345
345
|
status: i,
|
|
346
|
-
exchange:
|
|
346
|
+
exchange: d,
|
|
347
347
|
execute: S,
|
|
348
348
|
reset: w,
|
|
349
|
-
abort:
|
|
350
|
-
}, e[12] =
|
|
349
|
+
abort: $
|
|
350
|
+
}, e[12] = $, e[13] = l, e[14] = d, e[15] = S, e[16] = s, e[17] = w, e[18] = f, e[19] = i, e[20] = O) : O = e[20], O;
|
|
351
351
|
}
|
|
352
|
-
|
|
352
|
+
m(U, "useFetcher");
|
|
353
353
|
function me(r) {
|
|
354
354
|
const e = _(11), {
|
|
355
355
|
loading: t,
|
|
356
356
|
result: n,
|
|
357
357
|
error: c,
|
|
358
358
|
status: s,
|
|
359
|
-
exchange:
|
|
359
|
+
exchange: f,
|
|
360
360
|
execute: l,
|
|
361
361
|
reset: i,
|
|
362
362
|
abort: a
|
|
363
363
|
} = U(r), {
|
|
364
364
|
run: o,
|
|
365
365
|
cancel: u,
|
|
366
|
-
isPending:
|
|
367
|
-
} =
|
|
366
|
+
isPending: d
|
|
367
|
+
} = A(l, r.debounce);
|
|
368
368
|
let b;
|
|
369
|
-
return e[0] !== a || e[1] !== u || e[2] !== c || e[3] !==
|
|
369
|
+
return e[0] !== a || e[1] !== u || e[2] !== c || e[3] !== f || e[4] !== d || e[5] !== t || e[6] !== i || e[7] !== n || e[8] !== o || e[9] !== s ? (b = {
|
|
370
370
|
loading: t,
|
|
371
371
|
result: n,
|
|
372
372
|
error: c,
|
|
373
373
|
status: s,
|
|
374
|
-
exchange:
|
|
374
|
+
exchange: f,
|
|
375
375
|
reset: i,
|
|
376
376
|
abort: a,
|
|
377
377
|
run: o,
|
|
378
378
|
cancel: u,
|
|
379
|
-
isPending:
|
|
380
|
-
}, e[0] = a, e[1] = u, e[2] = c, e[3] =
|
|
379
|
+
isPending: d
|
|
380
|
+
}, e[0] = a, e[1] = u, e[2] = c, e[3] = f, e[4] = d, e[5] = t, e[6] = i, e[7] = n, e[8] = o, e[9] = s, e[10] = b) : b = e[10], b;
|
|
381
381
|
}
|
|
382
|
-
|
|
382
|
+
m(me, "useDebouncedFetcher");
|
|
383
383
|
function V(r) {
|
|
384
384
|
const e = _(10), {
|
|
385
385
|
initialQuery: t,
|
|
386
386
|
autoExecute: n,
|
|
387
387
|
execute: c
|
|
388
|
-
} = r, s = n ?? !1,
|
|
388
|
+
} = r, s = n ?? !1, f = F(t);
|
|
389
389
|
let l;
|
|
390
|
-
e[0] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */
|
|
390
|
+
e[0] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ m(() => f.current, "t0"), e[0] = l) : l = e[0];
|
|
391
391
|
const i = l;
|
|
392
392
|
let a;
|
|
393
|
-
e[1] !== s || e[2] !== c ? (a = /* @__PURE__ */
|
|
394
|
-
|
|
393
|
+
e[1] !== s || e[2] !== c ? (a = /* @__PURE__ */ m((y) => {
|
|
394
|
+
f.current = y, s && c(y);
|
|
395
395
|
}, "t1"), e[1] = s, e[2] = c, e[3] = a) : a = e[3];
|
|
396
396
|
const o = a;
|
|
397
|
-
let u,
|
|
398
|
-
e[4] !== s || e[5] !== c ? (u = /* @__PURE__ */
|
|
399
|
-
s && c(
|
|
400
|
-
}, "t2"),
|
|
397
|
+
let u, d;
|
|
398
|
+
e[4] !== s || e[5] !== c ? (u = /* @__PURE__ */ m(() => {
|
|
399
|
+
s && c(f.current);
|
|
400
|
+
}, "t2"), d = [s, c], e[4] = s, e[5] = c, e[6] = u, e[7] = d) : (u = e[6], d = e[7]), L(u, d);
|
|
401
401
|
let b;
|
|
402
402
|
return e[8] !== o ? (b = {
|
|
403
403
|
getQuery: i,
|
|
404
404
|
setQuery: o
|
|
405
405
|
}, e[8] = o, e[9] = b) : b = e[9], b;
|
|
406
406
|
}
|
|
407
|
-
|
|
407
|
+
m(V, "useQueryState");
|
|
408
408
|
function p(r) {
|
|
409
409
|
const e = R(r), {
|
|
410
410
|
loading: t,
|
|
411
411
|
result: n,
|
|
412
412
|
error: c,
|
|
413
413
|
status: s,
|
|
414
|
-
execute:
|
|
414
|
+
execute: f,
|
|
415
415
|
reset: l,
|
|
416
416
|
abort: i
|
|
417
|
-
} =
|
|
417
|
+
} = q(e.current), a = g((b) => f(/* @__PURE__ */ m(async (h) => e.current.execute(b, e.current.attributes, h), "queryExecutor")), [f, e]), {
|
|
418
418
|
getQuery: o,
|
|
419
419
|
setQuery: u
|
|
420
420
|
} = V({
|
|
421
421
|
initialQuery: r.initialQuery,
|
|
422
422
|
autoExecute: e.current.autoExecute,
|
|
423
423
|
execute: a
|
|
424
|
-
}),
|
|
425
|
-
return
|
|
424
|
+
}), d = g(() => a(o()), [a, o]);
|
|
425
|
+
return D(() => ({
|
|
426
426
|
loading: t,
|
|
427
427
|
result: n,
|
|
428
428
|
error: c,
|
|
429
429
|
status: s,
|
|
430
|
-
execute:
|
|
430
|
+
execute: d,
|
|
431
431
|
reset: l,
|
|
432
432
|
abort: i,
|
|
433
433
|
getQuery: o,
|
|
434
434
|
setQuery: u
|
|
435
|
-
}), [t, n, c, s,
|
|
435
|
+
}), [t, n, c, s, d, l, i, o, u]);
|
|
436
436
|
}
|
|
437
|
-
|
|
437
|
+
m(p, "useQuery");
|
|
438
438
|
function be(r) {
|
|
439
439
|
return p(r);
|
|
440
440
|
}
|
|
441
|
-
|
|
442
|
-
function
|
|
441
|
+
m(be, "useCountQuery");
|
|
442
|
+
function C(r) {
|
|
443
443
|
const e = _(22);
|
|
444
444
|
let t;
|
|
445
445
|
e[0] !== r ? (t = {
|
|
@@ -448,23 +448,23 @@ function O(r) {
|
|
|
448
448
|
}, e[0] = r, e[1] = t) : t = e[1];
|
|
449
449
|
const n = t, c = R(n), {
|
|
450
450
|
loading: s,
|
|
451
|
-
result:
|
|
451
|
+
result: f,
|
|
452
452
|
error: l,
|
|
453
453
|
status: i,
|
|
454
454
|
execute: a,
|
|
455
455
|
reset: o,
|
|
456
456
|
abort: u
|
|
457
457
|
} = U(n);
|
|
458
|
-
let
|
|
459
|
-
e[2] !== a || e[3] !== c ? (
|
|
458
|
+
let d;
|
|
459
|
+
e[2] !== a || e[3] !== c ? (d = /* @__PURE__ */ m((w) => {
|
|
460
460
|
const v = {
|
|
461
461
|
url: c.current.url,
|
|
462
462
|
method: "POST",
|
|
463
463
|
body: w
|
|
464
464
|
};
|
|
465
465
|
return a(v);
|
|
466
|
-
}, "t1"), e[2] = a, e[3] = c, e[4] =
|
|
467
|
-
const b =
|
|
466
|
+
}, "t1"), e[2] = a, e[3] = c, e[4] = d) : d = e[4];
|
|
467
|
+
const b = d;
|
|
468
468
|
let y;
|
|
469
469
|
e[5] !== b || e[6] !== n.autoExecute || e[7] !== n.initialQuery ? (y = {
|
|
470
470
|
initialQuery: n.initialQuery,
|
|
@@ -476,12 +476,12 @@ function O(r) {
|
|
|
476
476
|
setQuery: Q
|
|
477
477
|
} = V(y);
|
|
478
478
|
let x;
|
|
479
|
-
e[9] !== b || e[10] !== h ? (x = /* @__PURE__ */
|
|
479
|
+
e[9] !== b || e[10] !== h ? (x = /* @__PURE__ */ m(() => b(h()), "t3"), e[9] = b, e[10] = h, e[11] = x) : x = e[11];
|
|
480
480
|
const S = x;
|
|
481
481
|
let E;
|
|
482
|
-
return e[12] !== u || e[13] !== l || e[14] !== S || e[15] !== h || e[16] !== s || e[17] !== o || e[18] !==
|
|
482
|
+
return e[12] !== u || e[13] !== l || e[14] !== S || e[15] !== h || e[16] !== s || e[17] !== o || e[18] !== f || e[19] !== Q || e[20] !== i ? (E = {
|
|
483
483
|
loading: s,
|
|
484
|
-
result:
|
|
484
|
+
result: f,
|
|
485
485
|
error: l,
|
|
486
486
|
status: i,
|
|
487
487
|
execute: S,
|
|
@@ -489,68 +489,68 @@ function O(r) {
|
|
|
489
489
|
abort: u,
|
|
490
490
|
getQuery: h,
|
|
491
491
|
setQuery: Q
|
|
492
|
-
}, e[12] = u, e[13] = l, e[14] = S, e[15] = h, e[16] = s, e[17] = o, e[18] =
|
|
492
|
+
}, e[12] = u, e[13] = l, e[14] = S, e[15] = h, e[16] = s, e[17] = o, e[18] = f, e[19] = Q, e[20] = i, e[21] = E) : E = e[21], E;
|
|
493
493
|
}
|
|
494
|
-
|
|
494
|
+
m(C, "useFetcherQuery");
|
|
495
495
|
function ye(r) {
|
|
496
|
-
return
|
|
496
|
+
return C(r);
|
|
497
497
|
}
|
|
498
|
-
|
|
498
|
+
m(ye, "useFetcherCountQuery");
|
|
499
499
|
function he(r) {
|
|
500
|
-
return
|
|
500
|
+
return C(r);
|
|
501
501
|
}
|
|
502
|
-
|
|
502
|
+
m(he, "useFetcherListQuery");
|
|
503
503
|
function ge(r) {
|
|
504
504
|
const e = _(2);
|
|
505
505
|
let t;
|
|
506
506
|
return e[0] !== r ? (t = {
|
|
507
507
|
...r,
|
|
508
508
|
resultExtractor: H
|
|
509
|
-
}, e[0] = r, e[1] = t) : t = e[1],
|
|
509
|
+
}, e[0] = r, e[1] = t) : t = e[1], C(t);
|
|
510
510
|
}
|
|
511
|
-
|
|
511
|
+
m(ge, "useFetcherListStreamQuery");
|
|
512
512
|
function xe(r) {
|
|
513
|
-
return
|
|
513
|
+
return C(r);
|
|
514
514
|
}
|
|
515
|
-
|
|
515
|
+
m(xe, "useFetcherPagedQuery");
|
|
516
516
|
function Ee(r) {
|
|
517
|
-
return
|
|
517
|
+
return C(r);
|
|
518
518
|
}
|
|
519
|
-
|
|
519
|
+
m(Ee, "useFetcherSingleQuery");
|
|
520
520
|
function ve(r) {
|
|
521
521
|
return p(r);
|
|
522
522
|
}
|
|
523
|
-
|
|
523
|
+
m(ve, "useListQuery");
|
|
524
524
|
function Qe(r) {
|
|
525
525
|
return p(r);
|
|
526
526
|
}
|
|
527
|
-
|
|
527
|
+
m(Qe, "useListStreamQuery");
|
|
528
528
|
function Se(r) {
|
|
529
529
|
return p(r);
|
|
530
530
|
}
|
|
531
|
-
|
|
531
|
+
m(Se, "usePagedQuery");
|
|
532
532
|
function _e(r) {
|
|
533
533
|
return p(r);
|
|
534
534
|
}
|
|
535
|
-
|
|
535
|
+
m(_e, "useSingleQuery");
|
|
536
536
|
function we(r) {
|
|
537
537
|
const e = _(12), {
|
|
538
538
|
loading: t,
|
|
539
539
|
result: n,
|
|
540
540
|
error: c,
|
|
541
541
|
status: s,
|
|
542
|
-
execute:
|
|
542
|
+
execute: f,
|
|
543
543
|
reset: l,
|
|
544
544
|
abort: i,
|
|
545
545
|
getQuery: a,
|
|
546
546
|
setQuery: o
|
|
547
|
-
} =
|
|
547
|
+
} = C(r), {
|
|
548
548
|
run: u,
|
|
549
|
-
cancel:
|
|
549
|
+
cancel: d,
|
|
550
550
|
isPending: b
|
|
551
|
-
} =
|
|
551
|
+
} = A(f, r.debounce);
|
|
552
552
|
let y;
|
|
553
|
-
return e[0] !== i || e[1] !==
|
|
553
|
+
return e[0] !== i || e[1] !== d || e[2] !== c || e[3] !== a || e[4] !== b || e[5] !== t || e[6] !== l || e[7] !== n || e[8] !== u || e[9] !== o || e[10] !== s ? (y = {
|
|
554
554
|
loading: t,
|
|
555
555
|
result: n,
|
|
556
556
|
error: c,
|
|
@@ -560,24 +560,56 @@ function we(r) {
|
|
|
560
560
|
getQuery: a,
|
|
561
561
|
setQuery: o,
|
|
562
562
|
run: u,
|
|
563
|
-
cancel:
|
|
563
|
+
cancel: d,
|
|
564
564
|
isPending: b
|
|
565
|
-
}, e[0] = i, e[1] =
|
|
565
|
+
}, e[0] = i, e[1] = d, e[2] = c, e[3] = a, e[4] = b, e[5] = t, e[6] = l, e[7] = n, e[8] = u, e[9] = o, e[10] = s, e[11] = y) : y = e[11], y;
|
|
566
566
|
}
|
|
567
|
-
|
|
567
|
+
m(we, "useDebouncedFetcherQuery");
|
|
568
568
|
function Fe(r) {
|
|
569
|
+
const e = _(12), {
|
|
570
|
+
loading: t,
|
|
571
|
+
result: n,
|
|
572
|
+
error: c,
|
|
573
|
+
status: s,
|
|
574
|
+
execute: f,
|
|
575
|
+
reset: l,
|
|
576
|
+
abort: i,
|
|
577
|
+
getQuery: a,
|
|
578
|
+
setQuery: o
|
|
579
|
+
} = p(r), {
|
|
580
|
+
run: u,
|
|
581
|
+
cancel: d,
|
|
582
|
+
isPending: b
|
|
583
|
+
} = A(f, r.debounce);
|
|
584
|
+
let y;
|
|
585
|
+
return e[0] !== i || e[1] !== d || e[2] !== c || e[3] !== a || e[4] !== b || e[5] !== t || e[6] !== l || e[7] !== n || e[8] !== u || e[9] !== o || e[10] !== s ? (y = {
|
|
586
|
+
loading: t,
|
|
587
|
+
result: n,
|
|
588
|
+
error: c,
|
|
589
|
+
status: s,
|
|
590
|
+
reset: l,
|
|
591
|
+
abort: i,
|
|
592
|
+
getQuery: a,
|
|
593
|
+
setQuery: o,
|
|
594
|
+
run: u,
|
|
595
|
+
cancel: d,
|
|
596
|
+
isPending: b
|
|
597
|
+
}, e[0] = i, e[1] = d, e[2] = c, e[3] = a, e[4] = b, e[5] = t, e[6] = l, e[7] = n, e[8] = u, e[9] = o, e[10] = s, e[11] = y) : y = e[11], y;
|
|
598
|
+
}
|
|
599
|
+
m(Fe, "useDebouncedQuery");
|
|
600
|
+
function Re(r) {
|
|
569
601
|
const e = _(13), {
|
|
570
602
|
bus: t,
|
|
571
603
|
handler: n
|
|
572
604
|
} = r;
|
|
573
605
|
let c;
|
|
574
|
-
e[0] !== t || e[1] !== n ? (c = /* @__PURE__ */
|
|
606
|
+
e[0] !== t || e[1] !== n ? (c = /* @__PURE__ */ m(() => t.on(n), "t0"), e[0] = t, e[1] = n, e[2] = c) : c = e[2];
|
|
575
607
|
const s = c;
|
|
576
|
-
let
|
|
577
|
-
e[3] !== t || e[4] !== n.name ? (
|
|
578
|
-
const l =
|
|
608
|
+
let f;
|
|
609
|
+
e[3] !== t || e[4] !== n.name ? (f = /* @__PURE__ */ m(() => t.off(n.name), "t1"), e[3] = t, e[4] = n.name, e[5] = f) : f = e[5];
|
|
610
|
+
const l = f;
|
|
579
611
|
let i, a;
|
|
580
|
-
e[6] !== t || e[7] !== n ? (i = /* @__PURE__ */
|
|
612
|
+
e[6] !== t || e[7] !== n ? (i = /* @__PURE__ */ m(() => (t.on(n) || console.warn(`Failed to subscribe to event bus with handler: ${n.name}`), () => {
|
|
581
613
|
t.off(n.name);
|
|
582
614
|
}), "t2"), a = [t, n], e[6] = t, e[7] = n, e[8] = i, e[9] = a) : (i = e[8], a = e[9]), L(i, a);
|
|
583
615
|
let o;
|
|
@@ -586,22 +618,23 @@ function Fe(r) {
|
|
|
586
618
|
unsubscribe: l
|
|
587
619
|
}, e[10] = s, e[11] = l, e[12] = o) : o = e[12], o;
|
|
588
620
|
}
|
|
589
|
-
|
|
621
|
+
m(Re, "useEventSubscription");
|
|
590
622
|
export {
|
|
591
623
|
X as PromiseStatus,
|
|
592
624
|
be as useCountQuery,
|
|
593
|
-
|
|
625
|
+
A as useDebouncedCallback,
|
|
594
626
|
ae as useDebouncedExecutePromise,
|
|
595
627
|
me as useDebouncedFetcher,
|
|
596
|
-
we as
|
|
597
|
-
Fe as
|
|
598
|
-
|
|
628
|
+
we as useDebouncedFetcherQuery,
|
|
629
|
+
Fe as useDebouncedQuery,
|
|
630
|
+
Re as useEventSubscription,
|
|
631
|
+
q as useExecutePromise,
|
|
599
632
|
U as useFetcher,
|
|
600
633
|
ye as useFetcherCountQuery,
|
|
601
634
|
he as useFetcherListQuery,
|
|
602
635
|
ge as useFetcherListStreamQuery,
|
|
603
636
|
xe as useFetcherPagedQuery,
|
|
604
|
-
|
|
637
|
+
C as useFetcherQuery,
|
|
605
638
|
Ee as useFetcherSingleQuery,
|
|
606
639
|
fe as useForceUpdate,
|
|
607
640
|
de as useImmerKeyStorage,
|