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