@hortiview/modulebase 0.0.12333 → 0.0.12550
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/dist/QueryClientProvider-Q_mWQTzQ.js +435 -0
- package/dist/components/ModuleBase.js +509 -10
- package/dist/hooks/useCustom.js +1 -1
- package/dist/hooks/useCustomMutation.js +11 -102
- package/dist/hooks/useEntity.d.ts +2 -8
- package/dist/hooks/useEntity.js +1 -1
- package/dist/hooks/useOption.js +1 -1
- package/dist/hooks/useServiceBus.d.ts +15 -0
- package/dist/hooks/useServiceBus.js +17 -0
- package/dist/hooks/useStores.d.ts +2 -1
- package/dist/main.d.ts +1 -0
- package/dist/main.js +118 -116
- package/dist/mutation-X73nm7Df.js +192 -0
- package/dist/query-CRIVoEP7.js +277 -0
- package/dist/types/BaseProps.d.ts +3 -0
- package/dist/types/ModuleApi.d.ts +75 -4
- package/dist/types/ServiceBus.d.ts +17 -0
- package/dist/types/ServiceBus.js +1 -0
- package/dist/useMutation-3rykrmeD.js +97 -0
- package/dist/{useQuery-DtzakC1A.js → useQuery-CwwWze9O.js} +47 -53
- package/dist/utils-DxRR_XLb.js +9 -0
- package/package.json +1 -1
- package/dist/ModuleBase-brrfWM_W.js +0 -697
- package/dist/QueryClientProvider-QWqHaM3I.js +0 -707
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { u } from "../useMutation-3rykrmeD.js";
|
|
2
|
+
import { useBasePropsStore as t } from "../stores/BasePropsStore.js";
|
|
3
|
+
const f = ({
|
|
4
|
+
authenticationKey: i,
|
|
5
|
+
queue: e,
|
|
6
|
+
topic: s
|
|
7
|
+
}) => {
|
|
8
|
+
const r = t((o) => o.serviceBusNotification), n = t((o) => o.throwError);
|
|
9
|
+
if (!r)
|
|
10
|
+
throw n?.("serviceBusNotification is not defined", 400);
|
|
11
|
+
return u({
|
|
12
|
+
mutationFn: (o) => r(o, i, e, s)
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
f as useServiceBus
|
|
17
|
+
};
|
|
@@ -9,6 +9,7 @@ export declare const useBaseProps: () => Pick<import('../types/Deprecated').Depr
|
|
|
9
9
|
currentLanguageId?: string;
|
|
10
10
|
alertRules?: string;
|
|
11
11
|
commonOptions?: import('../types/CommonOptions').AllDropdownsData<import('../types/CommonOptions').CommonOption>["items"];
|
|
12
|
+
serviceBusNotification?: (message: import('../types/ServiceBus').AlertServiceBusMessage, apiKey: string, queue: string, topic: string) => Promise<unknown>;
|
|
12
13
|
navigateInHortiview?: (path: string) => void;
|
|
13
14
|
addBreadcrumbTranslation?: (translation: {
|
|
14
15
|
key: string;
|
|
@@ -21,7 +22,7 @@ export declare const useBaseProps: () => Pick<import('../types/Deprecated').Depr
|
|
|
21
22
|
throwError?: (message: string, code: number) => void;
|
|
22
23
|
} & {
|
|
23
24
|
setBaseProps: (props: import('../main').BaseProps) => void;
|
|
24
|
-
}, keyof import('../types/Deprecated').DeprecatedBaseProps | "modulePermissionToken" | "moduleId" | "organizationId" | "basePath" | "currentNavigationPath" | "sourcePath" | "currentLanguage" | "currentLanguageId" | "alertRules" | "commonOptions" | "navigateInHortiview" | "addBreadcrumbTranslation" | "showSnackbar" | "showMessage" | "logEvent" | "logError" | "throwError">;
|
|
25
|
+
}, keyof import('../types/Deprecated').DeprecatedBaseProps | "modulePermissionToken" | "moduleId" | "organizationId" | "basePath" | "currentNavigationPath" | "sourcePath" | "currentLanguage" | "currentLanguageId" | "alertRules" | "commonOptions" | "serviceBusNotification" | "navigateInHortiview" | "addBreadcrumbTranslation" | "showSnackbar" | "showMessage" | "logEvent" | "logError" | "throwError">;
|
|
25
26
|
export declare const useConfig: () => Pick<{
|
|
26
27
|
environment: import('../types/Environment').HortiViewEnvironments;
|
|
27
28
|
setEnvironment: (environment: import('../types/Environment').HortiViewEnvironments) => void;
|
package/dist/main.d.ts
CHANGED
|
@@ -9,4 +9,5 @@ export { useCustom } from './hooks/useCustom';
|
|
|
9
9
|
export { useEntity } from './hooks/useEntity';
|
|
10
10
|
export { useOption } from './hooks/useOption';
|
|
11
11
|
export { useCustomMutation } from './hooks/useCustomMutation';
|
|
12
|
+
export { useServiceBus } from './hooks/useServiceBus';
|
|
12
13
|
export { mutateOnCustomApi } from './utils/fetches';
|
package/dist/main.js
CHANGED
|
@@ -1,134 +1,136 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ModuleBase as s } from "./components/ModuleBase.js";
|
|
2
2
|
import { useBreadcrumbTranslation as r } from "./hooks/useBreadcrumbTranslation.js";
|
|
3
3
|
import { useSignalRMessages as u } from "./hooks/useSignalRMessages.js";
|
|
4
4
|
import { useNavigate as n } from "./module-router.js";
|
|
5
5
|
import { useBaseProps as S, useConfig as R } from "./hooks/useStores.js";
|
|
6
|
-
import { useCustom as
|
|
6
|
+
import { useCustom as E } from "./hooks/useCustom.js";
|
|
7
7
|
import { useEntity as l } from "./hooks/useEntity.js";
|
|
8
8
|
import { useOption as A } from "./hooks/useOption.js";
|
|
9
9
|
import { useCustomMutation as d } from "./hooks/useCustomMutation.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { useServiceBus as h } from "./hooks/useServiceBus.js";
|
|
11
|
+
import { mutateOnCustomApi as x } from "./utils/fetches.js";
|
|
12
|
+
import { A as g, B as v, F as P, H as f, I as y, a as L, b as k, L as D, c as H, M, d as B, N as O, e as b, f as T, O as w, P as I, R as V, g as q, h as z, i as G, S as K, j as W, k as j, l as J, m as Q, D as X, n as Y, E as Z, o as $, p as aa, q as ea, r as sa, s as ta, t as ra, u as oa, v as ua, V as ia, w as na, x as ca, y as Sa, z as Ra, C as ma, G as Ea, J as Fa, K as la, Q as Na, T as Aa, U as _a, W as da, X as pa, Y as ha, Z as Ua, _ as xa, $ as Ca, a0 as ga, a1 as va, a2 as Pa, a3 as fa, a4 as ya, a5 as La, a6 as ka, a7 as Da, a8 as Ha, a9 as Ma, aa as Ba, ab as Oa, ac as ba, ad as Ta, ae as wa, af as Ia, ag as Va, ah as qa, ai as za, aj as Ga, ak as Ka, al as Wa, am as ja, an as Ja, ao as Qa, ap as Xa, aq as Ya, ar as Za, as as $a, at as ae, au as ee, av as se, aw as te, ax as re, ay as oe, az as ue, aA as ie, aB as ne, aC as ce, aD as Se, aE as Re, aF as me, aG as Ee, aH as Fe, aI as le, aJ as Ne, aK as Ae, aL as _e, aM as de, aN as pe, aO as he, aP as Ue, aQ as xe, aR as Ce, aS as ge, aT as ve } from "./chunk-IR6S3I6Y-BmDdD3SP.js";
|
|
12
13
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
g as Await,
|
|
15
|
+
v as BrowserRouter,
|
|
16
|
+
P as Form,
|
|
17
|
+
f as HashRouter,
|
|
18
|
+
y as IDLE_BLOCKER,
|
|
19
|
+
L as IDLE_FETCHER,
|
|
20
|
+
k as IDLE_NAVIGATION,
|
|
21
|
+
D as Link,
|
|
22
|
+
H as Links,
|
|
23
|
+
M as MemoryRouter,
|
|
24
|
+
B as Meta,
|
|
24
25
|
s as ModuleBase,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
26
|
+
O as NavLink,
|
|
27
|
+
b as Navigate,
|
|
28
|
+
T as NavigationType,
|
|
29
|
+
w as Outlet,
|
|
30
|
+
I as PrefetchPageLinks,
|
|
31
|
+
V as Route,
|
|
32
|
+
q as Router,
|
|
33
|
+
z as RouterProvider,
|
|
34
|
+
G as Routes,
|
|
35
|
+
K as Scripts,
|
|
36
|
+
W as ScrollRestoration,
|
|
37
|
+
j as ServerRouter,
|
|
38
|
+
J as StaticRouter,
|
|
39
|
+
Q as StaticRouterProvider,
|
|
40
|
+
X as UNSAFE_DataRouterContext,
|
|
41
|
+
Y as UNSAFE_DataRouterStateContext,
|
|
42
|
+
Z as UNSAFE_ErrorResponseImpl,
|
|
43
|
+
$ as UNSAFE_FetchersContext,
|
|
44
|
+
aa as UNSAFE_FrameworkContext,
|
|
45
|
+
ea as UNSAFE_LocationContext,
|
|
46
|
+
sa as UNSAFE_NavigationContext,
|
|
47
|
+
ta as UNSAFE_RemixErrorBoundary,
|
|
48
|
+
ra as UNSAFE_RouteContext,
|
|
49
|
+
oa as UNSAFE_ServerMode,
|
|
50
|
+
ua as UNSAFE_SingleFetchRedirectSymbol,
|
|
51
|
+
ia as UNSAFE_ViewTransitionContext,
|
|
52
|
+
na as UNSAFE_createBrowserHistory,
|
|
53
|
+
ca as UNSAFE_createClientRoutes,
|
|
54
|
+
Sa as UNSAFE_createClientRoutesWithHMRRevalidationOptOut,
|
|
55
|
+
Ra as UNSAFE_createRouter,
|
|
56
|
+
ma as UNSAFE_decodeViaTurboStream,
|
|
57
|
+
Ea as UNSAFE_deserializeErrors,
|
|
58
|
+
Fa as UNSAFE_getPatchRoutesOnNavigationFunction,
|
|
59
|
+
la as UNSAFE_getSingleFetchDataStrategy,
|
|
60
|
+
Na as UNSAFE_invariant,
|
|
61
|
+
Aa as UNSAFE_mapRouteProperties,
|
|
62
|
+
_a as UNSAFE_shouldHydrateRouteLoader,
|
|
63
|
+
da as UNSAFE_useFogOFWarDiscovery,
|
|
64
|
+
pa as UNSAFE_useScrollRestoration,
|
|
65
|
+
ha as createBrowserRouter,
|
|
66
|
+
Ua as createCookie,
|
|
67
|
+
xa as createCookieSessionStorage,
|
|
68
|
+
Ca as createHashRouter,
|
|
69
|
+
ga as createMemoryRouter,
|
|
70
|
+
va as createMemorySessionStorage,
|
|
71
|
+
Pa as createPath,
|
|
72
|
+
fa as createRequestHandler,
|
|
73
|
+
ya as createRoutesFromChildren,
|
|
74
|
+
La as createRoutesFromElements,
|
|
75
|
+
ka as createRoutesStub,
|
|
76
|
+
Da as createSearchParams,
|
|
77
|
+
Ha as createSession,
|
|
78
|
+
Ma as createSessionStorage,
|
|
79
|
+
Ba as createStaticHandler,
|
|
80
|
+
Oa as createStaticRouter,
|
|
81
|
+
ba as data,
|
|
82
|
+
Ta as generatePath,
|
|
83
|
+
wa as isCookie,
|
|
84
|
+
Ia as isRouteErrorResponse,
|
|
85
|
+
Va as isSession,
|
|
86
|
+
qa as matchPath,
|
|
87
|
+
za as matchRoutes,
|
|
88
|
+
x as mutateOnCustomApi,
|
|
89
|
+
Ga as parsePath,
|
|
90
|
+
Ka as redirect,
|
|
91
|
+
Wa as redirectDocument,
|
|
92
|
+
ja as renderMatches,
|
|
93
|
+
Ja as replace,
|
|
94
|
+
Qa as resolvePath,
|
|
95
|
+
Xa as unstable_HistoryRouter,
|
|
96
|
+
Ya as unstable_setDevServerHooks,
|
|
97
|
+
Za as unstable_usePrompt,
|
|
98
|
+
$a as useActionData,
|
|
99
|
+
ae as useAsyncError,
|
|
100
|
+
ee as useAsyncValue,
|
|
100
101
|
S as useBaseProps,
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
se as useBeforeUnload,
|
|
103
|
+
te as useBlocker,
|
|
103
104
|
r as useBreadcrumbTranslation,
|
|
104
105
|
R as useConfig,
|
|
105
|
-
|
|
106
|
+
E as useCustom,
|
|
106
107
|
d as useCustomMutation,
|
|
107
108
|
l as useEntity,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
109
|
+
re as useFetcher,
|
|
110
|
+
oe as useFetchers,
|
|
111
|
+
ue as useFormAction,
|
|
112
|
+
ie as useHref,
|
|
113
|
+
ne as useInRouterContext,
|
|
114
|
+
ce as useLinkClickHandler,
|
|
115
|
+
Se as useLoaderData,
|
|
116
|
+
Re as useLocation,
|
|
117
|
+
me as useMatch,
|
|
118
|
+
Ee as useMatches,
|
|
118
119
|
n as useNavigate,
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
Fe as useNavigation,
|
|
121
|
+
le as useNavigationType,
|
|
121
122
|
A as useOption,
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
123
|
+
Ne as useOutlet,
|
|
124
|
+
Ae as useOutletContext,
|
|
125
|
+
_e as useParams,
|
|
126
|
+
de as useResolvedPath,
|
|
127
|
+
pe as useRevalidator,
|
|
128
|
+
he as useRouteError,
|
|
129
|
+
Ue as useRouteLoaderData,
|
|
130
|
+
xe as useRoutes,
|
|
131
|
+
Ce as useSearchParams,
|
|
132
|
+
h as useServiceBus,
|
|
131
133
|
u as useSignalRMessages,
|
|
132
|
-
|
|
133
|
-
|
|
134
|
+
ge as useSubmit,
|
|
135
|
+
ve as useViewTransitionState
|
|
134
136
|
};
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { R as o, c as a, n as r } from "./QueryClientProvider-Q_mWQTzQ.js";
|
|
2
|
+
var d = class extends o {
|
|
3
|
+
#e;
|
|
4
|
+
#t;
|
|
5
|
+
#i;
|
|
6
|
+
constructor(t) {
|
|
7
|
+
super(), this.mutationId = t.mutationId, this.#t = t.mutationCache, this.#e = [], this.state = t.state || u(), this.setOptions(t.options), this.scheduleGc();
|
|
8
|
+
}
|
|
9
|
+
setOptions(t) {
|
|
10
|
+
this.options = t, this.updateGcTime(this.options.gcTime);
|
|
11
|
+
}
|
|
12
|
+
get meta() {
|
|
13
|
+
return this.options.meta;
|
|
14
|
+
}
|
|
15
|
+
addObserver(t) {
|
|
16
|
+
this.#e.includes(t) || (this.#e.push(t), this.clearGcTimeout(), this.#t.notify({
|
|
17
|
+
type: "observerAdded",
|
|
18
|
+
mutation: this,
|
|
19
|
+
observer: t
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
removeObserver(t) {
|
|
23
|
+
this.#e = this.#e.filter((i) => i !== t), this.scheduleGc(), this.#t.notify({
|
|
24
|
+
type: "observerRemoved",
|
|
25
|
+
mutation: this,
|
|
26
|
+
observer: t
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
optionalRemove() {
|
|
30
|
+
this.#e.length || (this.state.status === "pending" ? this.scheduleGc() : this.#t.remove(this));
|
|
31
|
+
}
|
|
32
|
+
continue() {
|
|
33
|
+
return this.#i?.continue() ?? // continuing a mutation assumes that variables are set, mutation must have been dehydrated before
|
|
34
|
+
this.execute(this.state.variables);
|
|
35
|
+
}
|
|
36
|
+
async execute(t) {
|
|
37
|
+
this.#i = a({
|
|
38
|
+
fn: () => this.options.mutationFn ? this.options.mutationFn(t) : Promise.reject(new Error("No mutationFn found")),
|
|
39
|
+
onFail: (e, n) => {
|
|
40
|
+
this.#s({ type: "failed", failureCount: e, error: n });
|
|
41
|
+
},
|
|
42
|
+
onPause: () => {
|
|
43
|
+
this.#s({ type: "pause" });
|
|
44
|
+
},
|
|
45
|
+
onContinue: () => {
|
|
46
|
+
this.#s({ type: "continue" });
|
|
47
|
+
},
|
|
48
|
+
retry: this.options.retry ?? 0,
|
|
49
|
+
retryDelay: this.options.retryDelay,
|
|
50
|
+
networkMode: this.options.networkMode,
|
|
51
|
+
canRun: () => this.#t.canRun(this)
|
|
52
|
+
});
|
|
53
|
+
const i = this.state.status === "pending", s = !this.#i.canStart();
|
|
54
|
+
try {
|
|
55
|
+
if (!i) {
|
|
56
|
+
this.#s({ type: "pending", variables: t, isPaused: s }), await this.#t.config.onMutate?.(
|
|
57
|
+
t,
|
|
58
|
+
this
|
|
59
|
+
);
|
|
60
|
+
const n = await this.options.onMutate?.(t);
|
|
61
|
+
n !== this.state.context && this.#s({
|
|
62
|
+
type: "pending",
|
|
63
|
+
context: n,
|
|
64
|
+
variables: t,
|
|
65
|
+
isPaused: s
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
const e = await this.#i.start();
|
|
69
|
+
return await this.#t.config.onSuccess?.(
|
|
70
|
+
e,
|
|
71
|
+
t,
|
|
72
|
+
this.state.context,
|
|
73
|
+
this
|
|
74
|
+
), await this.options.onSuccess?.(e, t, this.state.context), await this.#t.config.onSettled?.(
|
|
75
|
+
e,
|
|
76
|
+
null,
|
|
77
|
+
this.state.variables,
|
|
78
|
+
this.state.context,
|
|
79
|
+
this
|
|
80
|
+
), await this.options.onSettled?.(e, null, t, this.state.context), this.#s({ type: "success", data: e }), e;
|
|
81
|
+
} catch (e) {
|
|
82
|
+
try {
|
|
83
|
+
throw await this.#t.config.onError?.(
|
|
84
|
+
e,
|
|
85
|
+
t,
|
|
86
|
+
this.state.context,
|
|
87
|
+
this
|
|
88
|
+
), await this.options.onError?.(
|
|
89
|
+
e,
|
|
90
|
+
t,
|
|
91
|
+
this.state.context
|
|
92
|
+
), await this.#t.config.onSettled?.(
|
|
93
|
+
void 0,
|
|
94
|
+
e,
|
|
95
|
+
this.state.variables,
|
|
96
|
+
this.state.context,
|
|
97
|
+
this
|
|
98
|
+
), await this.options.onSettled?.(
|
|
99
|
+
void 0,
|
|
100
|
+
e,
|
|
101
|
+
t,
|
|
102
|
+
this.state.context
|
|
103
|
+
), e;
|
|
104
|
+
} finally {
|
|
105
|
+
this.#s({ type: "error", error: e });
|
|
106
|
+
}
|
|
107
|
+
} finally {
|
|
108
|
+
this.#t.runNext(this);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
#s(t) {
|
|
112
|
+
const i = (s) => {
|
|
113
|
+
switch (t.type) {
|
|
114
|
+
case "failed":
|
|
115
|
+
return {
|
|
116
|
+
...s,
|
|
117
|
+
failureCount: t.failureCount,
|
|
118
|
+
failureReason: t.error
|
|
119
|
+
};
|
|
120
|
+
case "pause":
|
|
121
|
+
return {
|
|
122
|
+
...s,
|
|
123
|
+
isPaused: !0
|
|
124
|
+
};
|
|
125
|
+
case "continue":
|
|
126
|
+
return {
|
|
127
|
+
...s,
|
|
128
|
+
isPaused: !1
|
|
129
|
+
};
|
|
130
|
+
case "pending":
|
|
131
|
+
return {
|
|
132
|
+
...s,
|
|
133
|
+
context: t.context,
|
|
134
|
+
data: void 0,
|
|
135
|
+
failureCount: 0,
|
|
136
|
+
failureReason: null,
|
|
137
|
+
error: null,
|
|
138
|
+
isPaused: t.isPaused,
|
|
139
|
+
status: "pending",
|
|
140
|
+
variables: t.variables,
|
|
141
|
+
submittedAt: Date.now()
|
|
142
|
+
};
|
|
143
|
+
case "success":
|
|
144
|
+
return {
|
|
145
|
+
...s,
|
|
146
|
+
data: t.data,
|
|
147
|
+
failureCount: 0,
|
|
148
|
+
failureReason: null,
|
|
149
|
+
error: null,
|
|
150
|
+
status: "success",
|
|
151
|
+
isPaused: !1
|
|
152
|
+
};
|
|
153
|
+
case "error":
|
|
154
|
+
return {
|
|
155
|
+
...s,
|
|
156
|
+
data: void 0,
|
|
157
|
+
error: t.error,
|
|
158
|
+
failureCount: s.failureCount + 1,
|
|
159
|
+
failureReason: t.error,
|
|
160
|
+
isPaused: !1,
|
|
161
|
+
status: "error"
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
this.state = i(this.state), r.batch(() => {
|
|
166
|
+
this.#e.forEach((s) => {
|
|
167
|
+
s.onMutationUpdate(t);
|
|
168
|
+
}), this.#t.notify({
|
|
169
|
+
mutation: this,
|
|
170
|
+
type: "updated",
|
|
171
|
+
action: t
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
function u() {
|
|
177
|
+
return {
|
|
178
|
+
context: void 0,
|
|
179
|
+
data: void 0,
|
|
180
|
+
error: null,
|
|
181
|
+
failureCount: 0,
|
|
182
|
+
failureReason: null,
|
|
183
|
+
isPaused: !1,
|
|
184
|
+
status: "idle",
|
|
185
|
+
variables: void 0,
|
|
186
|
+
submittedAt: 0
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
export {
|
|
190
|
+
d as M,
|
|
191
|
+
u as g
|
|
192
|
+
};
|