@nexigen/entity-normalizer 0.3.0 → 0.4.0
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/async/async-duck.d.ts +9 -1
- package/dist/async/async-duck.js +98 -30
- package/dist/async/async-duck.js.map +1 -1
- package/dist/async/cancel.d.ts +4 -0
- package/dist/async/cancel.js +32 -0
- package/dist/async/cancel.js.map +1 -0
- package/dist/async/execution-context.d.ts +6 -2
- package/dist/async/execution-context.js +36 -7
- package/dist/async/execution-context.js.map +1 -1
- package/dist/async/public.d.ts +4 -2
- package/dist/root/coreApi/create-core-api.js.map +1 -1
- package/dist/root/coreApi/types.d.ts +4 -2
- package/dist/root/root-store.d.ts +1 -1
- package/dist/root/root-store.js +10 -41
- package/dist/root/root-store.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,22 +5,30 @@ export declare class AsyncDuck<TParams, TResult> {
|
|
|
5
5
|
private _error;
|
|
6
6
|
private _data;
|
|
7
7
|
private _hasEverRun;
|
|
8
|
+
private _inFlight;
|
|
9
|
+
private _lastSuccessParams?;
|
|
10
|
+
private _lastRunSucceeded;
|
|
8
11
|
private fn;
|
|
9
12
|
private _keyed;
|
|
10
13
|
private _proxy?;
|
|
11
|
-
private _pendingPromise;
|
|
12
14
|
private _lastRunParams?;
|
|
15
|
+
private _abortController;
|
|
16
|
+
private _tokenCounter;
|
|
17
|
+
private _activeToken;
|
|
13
18
|
constructor(fn: (params?: TParams) => Promise<TResult>);
|
|
14
19
|
getKeyed(key: string): AsyncDuck<TParams, TResult>;
|
|
15
20
|
private setLoading;
|
|
16
21
|
private setSuccess;
|
|
17
22
|
private setError;
|
|
23
|
+
private abortAndInvalidate;
|
|
18
24
|
reset(): void;
|
|
25
|
+
cancel(): void;
|
|
19
26
|
private sleep;
|
|
20
27
|
private runWithRetry;
|
|
21
28
|
run(options?: RunOptions<TParams, TResult>): Promise<TResult | undefined>;
|
|
22
29
|
refresh(): Promise<TResult | undefined>;
|
|
23
30
|
get isLoading(): boolean;
|
|
31
|
+
get isInFlight(): boolean;
|
|
24
32
|
get isRetrying(): boolean;
|
|
25
33
|
get isError(): boolean;
|
|
26
34
|
get isSuccess(): boolean;
|
package/dist/async/async-duck.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { makeObservable, observable, action } from 'mobx';
|
|
1
|
+
import { makeObservable, observable, action, runInAction } from 'mobx';
|
|
2
|
+
import { CanceledError, isCanceled } from './cancel';
|
|
2
3
|
import { executionAsyncContext } from './execution-context';
|
|
3
4
|
import { DUCK_TAG } from './marker';
|
|
4
5
|
import { defaultRetryStrategy } from './retry';
|
|
@@ -9,8 +10,12 @@ export class AsyncDuck {
|
|
|
9
10
|
this._error = null;
|
|
10
11
|
this._data = null;
|
|
11
12
|
this._hasEverRun = false;
|
|
13
|
+
this._inFlight = false;
|
|
14
|
+
this._lastRunSucceeded = false;
|
|
12
15
|
this._keyed = new Map();
|
|
13
|
-
this.
|
|
16
|
+
this._abortController = null;
|
|
17
|
+
this._tokenCounter = 0;
|
|
18
|
+
this._activeToken = 0;
|
|
14
19
|
this.fn = fn;
|
|
15
20
|
this._proxy = new Proxy(this, {
|
|
16
21
|
get: (target, prop) => {
|
|
@@ -35,6 +40,7 @@ export class AsyncDuck {
|
|
|
35
40
|
setSuccess: action,
|
|
36
41
|
setError: action,
|
|
37
42
|
reset: action,
|
|
43
|
+
cancel: action,
|
|
38
44
|
});
|
|
39
45
|
}
|
|
40
46
|
// -------------------------------------
|
|
@@ -60,6 +66,8 @@ export class AsyncDuck {
|
|
|
60
66
|
this._isLoading = false;
|
|
61
67
|
this._isRetrying = false;
|
|
62
68
|
this._hasEverRun = true;
|
|
69
|
+
this._lastRunSucceeded = true;
|
|
70
|
+
this._lastSuccessParams = this._lastRunParams;
|
|
63
71
|
onSuccess?.(data);
|
|
64
72
|
}
|
|
65
73
|
setError(err, onError) {
|
|
@@ -68,43 +76,86 @@ export class AsyncDuck {
|
|
|
68
76
|
this._isLoading = false;
|
|
69
77
|
this._isRetrying = false;
|
|
70
78
|
this._hasEverRun = true;
|
|
79
|
+
this._lastRunSucceeded = false;
|
|
71
80
|
onError?.(normalized);
|
|
72
81
|
}
|
|
82
|
+
abortAndInvalidate() {
|
|
83
|
+
if (this._abortController && (this._isLoading || this._isRetrying)) {
|
|
84
|
+
this._abortController.abort();
|
|
85
|
+
}
|
|
86
|
+
this._abortController = null;
|
|
87
|
+
this._activeToken = ++this._tokenCounter;
|
|
88
|
+
}
|
|
73
89
|
reset() {
|
|
74
|
-
this.
|
|
75
|
-
this._isRetrying = false;
|
|
90
|
+
this.cancel();
|
|
76
91
|
this._error = null;
|
|
77
92
|
this._data = null;
|
|
78
93
|
this._hasEverRun = false;
|
|
79
|
-
this.
|
|
94
|
+
this._lastSuccessParams = undefined;
|
|
80
95
|
this._lastRunParams = undefined;
|
|
81
96
|
}
|
|
97
|
+
cancel() {
|
|
98
|
+
this.abortAndInvalidate();
|
|
99
|
+
this.setLoading(false);
|
|
100
|
+
}
|
|
82
101
|
// -------------------------------------
|
|
83
102
|
// UTILS
|
|
84
103
|
// -------------------------------------
|
|
85
|
-
sleep(ms) {
|
|
86
|
-
return new Promise(
|
|
104
|
+
sleep(ms, signal) {
|
|
105
|
+
return new Promise((resolve, reject) => {
|
|
106
|
+
if (!signal) {
|
|
107
|
+
setTimeout(resolve, ms);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (signal.aborted) {
|
|
111
|
+
reject(new CanceledError());
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
let timer = null;
|
|
115
|
+
const onAbort = () => {
|
|
116
|
+
if (timer) {
|
|
117
|
+
clearTimeout(timer);
|
|
118
|
+
}
|
|
119
|
+
reject(new CanceledError());
|
|
120
|
+
};
|
|
121
|
+
timer = setTimeout(() => {
|
|
122
|
+
signal.removeEventListener('abort', onAbort);
|
|
123
|
+
resolve();
|
|
124
|
+
}, ms);
|
|
125
|
+
signal.addEventListener('abort', onAbort, { once: true });
|
|
126
|
+
});
|
|
87
127
|
}
|
|
88
128
|
// -------------------------------------
|
|
89
129
|
// RETRY ENGINE
|
|
90
130
|
// -------------------------------------
|
|
91
|
-
async runWithRetry(params, retryStrategy) {
|
|
131
|
+
async runWithRetry(params, retryStrategy, signal) {
|
|
92
132
|
const retry = { ...defaultRetryStrategy, ...retryStrategy };
|
|
93
133
|
const max = retry.retries ?? 0;
|
|
94
134
|
for (let attempt = 1; attempt <= max + 1; attempt++) {
|
|
135
|
+
if (signal?.aborted) {
|
|
136
|
+
throw new CanceledError();
|
|
137
|
+
}
|
|
95
138
|
try {
|
|
96
139
|
return await this.fn(params);
|
|
97
140
|
}
|
|
98
141
|
catch (error) {
|
|
142
|
+
if (isCanceled(error, signal)) {
|
|
143
|
+
throw new CanceledError();
|
|
144
|
+
}
|
|
99
145
|
const normalized = error instanceof Error ? error : new Error(String(error));
|
|
100
146
|
const should = retry.shouldRetry?.(normalized) ?? false;
|
|
101
147
|
const isLast = attempt > max;
|
|
102
148
|
if (!should || isLast) {
|
|
103
149
|
throw normalized;
|
|
104
150
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
151
|
+
runInAction(() => {
|
|
152
|
+
this._isRetrying = true;
|
|
153
|
+
});
|
|
154
|
+
const baseDelay = retry.delayMs ?? 0;
|
|
155
|
+
const delay = retry.backoff ? baseDelay * attempt : baseDelay;
|
|
156
|
+
if (delay > 0) {
|
|
157
|
+
await this.sleep(delay, signal);
|
|
158
|
+
}
|
|
108
159
|
}
|
|
109
160
|
}
|
|
110
161
|
throw new Error('Unexpected retry exit');
|
|
@@ -113,8 +164,12 @@ export class AsyncDuck {
|
|
|
113
164
|
// PUBLIC RUN
|
|
114
165
|
// -------------------------------------
|
|
115
166
|
async run(options) {
|
|
167
|
+
if (this._inFlight) {
|
|
168
|
+
return undefined;
|
|
169
|
+
}
|
|
170
|
+
this._inFlight = true;
|
|
116
171
|
if (options?.skip) {
|
|
117
|
-
return;
|
|
172
|
+
return undefined;
|
|
118
173
|
}
|
|
119
174
|
if (options?.key) {
|
|
120
175
|
return this.getKeyed(options.key).run({
|
|
@@ -122,41 +177,51 @@ export class AsyncDuck {
|
|
|
122
177
|
key: undefined,
|
|
123
178
|
});
|
|
124
179
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
if (this._isLoading || this._isRetrying) {
|
|
129
|
-
return this._pendingPromise;
|
|
130
|
-
}
|
|
180
|
+
const token = this._activeToken;
|
|
181
|
+
const controller = new AbortController();
|
|
182
|
+
this._abortController = controller;
|
|
131
183
|
const { params, onSuccess, onError, retryStrategy } = options ?? {};
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
const isRetry = !!retryStrategy;
|
|
136
|
-
this.setLoading(isRetry);
|
|
137
|
-
this._pendingPromise = (async () => {
|
|
184
|
+
this._lastRunParams = params;
|
|
185
|
+
this.setLoading(!!retryStrategy);
|
|
186
|
+
return executionAsyncContext.withAbort(controller.signal, async () => {
|
|
138
187
|
try {
|
|
188
|
+
const signal = executionAsyncContext.currentSignal();
|
|
139
189
|
const result = retryStrategy
|
|
140
|
-
? await this.runWithRetry(params, retryStrategy)
|
|
190
|
+
? await this.runWithRetry(params, retryStrategy, signal)
|
|
141
191
|
: await this.fn(params);
|
|
192
|
+
if (this._activeToken !== token) {
|
|
193
|
+
return undefined;
|
|
194
|
+
}
|
|
195
|
+
if (controller.signal.aborted) {
|
|
196
|
+
return undefined;
|
|
197
|
+
}
|
|
142
198
|
this.setSuccess(result, onSuccess);
|
|
143
199
|
return result;
|
|
144
200
|
}
|
|
145
201
|
catch (err) {
|
|
202
|
+
if (this._activeToken !== token) {
|
|
203
|
+
return undefined;
|
|
204
|
+
}
|
|
205
|
+
if (isCanceled(err, controller.signal)) {
|
|
206
|
+
this._isLoading = false;
|
|
207
|
+
this._isRetrying = false;
|
|
208
|
+
return undefined;
|
|
209
|
+
}
|
|
146
210
|
this.setError(err, onError);
|
|
147
211
|
return undefined;
|
|
148
212
|
}
|
|
149
213
|
finally {
|
|
150
|
-
this.
|
|
214
|
+
this._inFlight = false;
|
|
151
215
|
}
|
|
152
|
-
})
|
|
153
|
-
return this._pendingPromise;
|
|
216
|
+
});
|
|
154
217
|
}
|
|
155
218
|
refresh() {
|
|
156
|
-
if (!this.
|
|
219
|
+
if (!this._lastRunSucceeded) {
|
|
157
220
|
return Promise.resolve(undefined);
|
|
158
221
|
}
|
|
159
|
-
|
|
222
|
+
this._inFlight = false;
|
|
223
|
+
this.abortAndInvalidate();
|
|
224
|
+
return executionAsyncContext.withIntent('refresh', () => this.run({ params: this._lastSuccessParams }));
|
|
160
225
|
}
|
|
161
226
|
// -------------------------------------
|
|
162
227
|
// GETTERS
|
|
@@ -164,6 +229,9 @@ export class AsyncDuck {
|
|
|
164
229
|
get isLoading() {
|
|
165
230
|
return this._isLoading;
|
|
166
231
|
}
|
|
232
|
+
get isInFlight() {
|
|
233
|
+
return this._inFlight;
|
|
234
|
+
}
|
|
167
235
|
get isRetrying() {
|
|
168
236
|
return this._isRetrying;
|
|
169
237
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async-duck.js","sourceRoot":"","sources":["../../src/async/async-duck.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"async-duck.js","sourceRoot":"","sources":["../../src/async/async-duck.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAEvE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM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MAAM,CAAC;IACrB,CAAC;IACD,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,IAAI,UAAU;QACZ,OAAO;YACL,SAAS,EAAE,IAAI,CAAC,UAAU;YAC1B,UAAU,EAAE,IAAI,CAAC,WAAW;YAC5B,KAAK,EAAE,IAAI,CAAC,MAAM;YAClB,IAAI,EAAE,IAAI,CAAC,KAAK;YAChB,UAAU,EAAE,IAAI,CAAC,WAAW;YAC5B,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAC;IACJ,CAAC;IAED,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export class CanceledError extends Error {
|
|
2
|
+
constructor(message = 'canceled') {
|
|
3
|
+
super(message);
|
|
4
|
+
this.name = 'CanceledError';
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
export function isCanceled(err, signal) {
|
|
8
|
+
if (signal?.aborted) {
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
if (!err || typeof err !== 'object') {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
const anyErr = err;
|
|
15
|
+
// DOM / fetch
|
|
16
|
+
if (anyErr?.name === 'AbortError') {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
// axios v1
|
|
20
|
+
if (anyErr?.name === 'CanceledError') {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
if (anyErr?.code === 'ERR_CANCELED') {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
// internal
|
|
27
|
+
if (err instanceof CanceledError) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=cancel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancel.js","sourceRoot":"","sources":["../../src/async/cancel.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,aAAc,SAAQ,KAAK;IACtC,YAAY,OAAO,GAAG,UAAU;QAC9B,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC;IAC9B,CAAC;CACF;AAED,MAAM,UAAU,UAAU,CAAC,GAAY,EAAE,MAA2B;IAClE,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QACpC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,MAAM,GAAG,GAAU,CAAC;IAE1B,cAAc;IACd,IAAI,MAAM,EAAE,IAAI,KAAK,YAAY,EAAE,CAAC;QAClC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,WAAW;IACX,IAAI,MAAM,EAAE,IAAI,KAAK,eAAe,EAAE,CAAC;QACrC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,MAAM,EAAE,IAAI,KAAK,cAAc,EAAE,CAAC;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,WAAW;IACX,IAAI,GAAG,YAAY,aAAa,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -2,9 +2,13 @@ import { type ExecutionIntent } from './types';
|
|
|
2
2
|
import type { PublicExecutionContext } from './public';
|
|
3
3
|
export declare class ExecutionContext {
|
|
4
4
|
private stack;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
private push;
|
|
6
|
+
private pop;
|
|
7
|
+
private current;
|
|
8
|
+
withIntent<T>(intent: ExecutionIntent, fn: () => Promise<T>): Promise<T>;
|
|
7
9
|
is(intent: ExecutionIntent): boolean;
|
|
10
|
+
withAbort<T>(signal: AbortSignal, fn: () => Promise<T>): Promise<T>;
|
|
11
|
+
currentSignal(): AbortSignal | null;
|
|
8
12
|
}
|
|
9
13
|
export declare function createExecutionContext(): PublicExecutionContext;
|
|
10
14
|
export declare const executionAsyncContext: PublicExecutionContext;
|
|
@@ -2,20 +2,49 @@ export class ExecutionContext {
|
|
|
2
2
|
constructor() {
|
|
3
3
|
this.stack = [];
|
|
4
4
|
}
|
|
5
|
-
|
|
6
|
-
this.stack.push(
|
|
5
|
+
push(frame) {
|
|
6
|
+
this.stack.push(frame);
|
|
7
|
+
}
|
|
8
|
+
pop() {
|
|
9
|
+
this.stack.pop();
|
|
10
|
+
}
|
|
11
|
+
current() {
|
|
12
|
+
return (this.stack[this.stack.length - 1] ?? {
|
|
13
|
+
intent: 'normal',
|
|
14
|
+
signal: null,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
async withIntent(intent, fn) {
|
|
18
|
+
const parent = this.current();
|
|
19
|
+
this.push({
|
|
20
|
+
intent,
|
|
21
|
+
signal: parent.signal,
|
|
22
|
+
});
|
|
7
23
|
try {
|
|
8
24
|
return await fn();
|
|
9
25
|
}
|
|
10
26
|
finally {
|
|
11
|
-
this.
|
|
27
|
+
this.pop();
|
|
12
28
|
}
|
|
13
29
|
}
|
|
14
|
-
current() {
|
|
15
|
-
return this.stack[this.stack.length - 1] ?? 'normal';
|
|
16
|
-
}
|
|
17
30
|
is(intent) {
|
|
18
|
-
return this.current() === intent;
|
|
31
|
+
return this.current().intent === intent;
|
|
32
|
+
}
|
|
33
|
+
async withAbort(signal, fn) {
|
|
34
|
+
const parent = this.current();
|
|
35
|
+
this.push({
|
|
36
|
+
intent: parent.intent,
|
|
37
|
+
signal,
|
|
38
|
+
});
|
|
39
|
+
try {
|
|
40
|
+
return await fn();
|
|
41
|
+
}
|
|
42
|
+
finally {
|
|
43
|
+
this.pop();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
currentSignal() {
|
|
47
|
+
return this.current().signal;
|
|
19
48
|
}
|
|
20
49
|
}
|
|
21
50
|
export function createExecutionContext() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-context.js","sourceRoot":"","sources":["../../src/async/execution-context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"execution-context.js","sourceRoot":"","sources":["../../src/async/execution-context.ts"],"names":[],"mappings":"AASA,MAAM,OAAO,gBAAgB;IAA7B;QACU,UAAK,GAAqB,EAAE,CAAC;IA2DvC,CAAC;IAzDS,IAAI,CAAC,KAAqB;QAChC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;IAEO,GAAG;QACT,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;IACnB,CAAC;IAEO,OAAO;QACb,OAAO,CACL,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI;YACnC,MAAM,EAAE,QAAQ;YAChB,MAAM,EAAE,IAAI;SACb,CACF,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,UAAU,CACd,MAAuB,EACvB,EAAoB;QAEpB,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAE9B,IAAI,CAAC,IAAI,CAAC;YACR,MAAM;YACN,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAC,CAAC;QAEH,IAAI,CAAC;YACH,OAAO,MAAM,EAAE,EAAE,CAAC;QACpB,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,GAAG,EAAE,CAAC;QACb,CAAC;IACH,CAAC;IAED,EAAE,CAAC,MAAuB;QACxB,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,KAAK,MAAM,CAAC;IAC1C,CAAC;IAED,KAAK,CAAC,SAAS,CAAI,MAAmB,EAAE,EAAoB;QAC1D,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAE9B,IAAI,CAAC,IAAI,CAAC;YACR,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,MAAM;SACP,CAAC,CAAC;QAEH,IAAI,CAAC;YACH,OAAO,MAAM,EAAE,EAAE,CAAC;QACpB,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,GAAG,EAAE,CAAC;QACb,CAAC;IACH,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC;IAC/B,CAAC;CACF;AAED,MAAM,UAAU,sBAAsB;IACpC,OAAO,IAAI,gBAAgB,EAAE,CAAC;AAChC,CAAC;AAED,MAAM,CAAC,MAAM,qBAAqB,GAChC,sBAAsB,EAAE,CAAC"}
|
package/dist/async/public.d.ts
CHANGED
|
@@ -14,13 +14,15 @@ export type RunOptions<TParams, TResult> = {
|
|
|
14
14
|
retryStrategy?: RetryStrategy;
|
|
15
15
|
};
|
|
16
16
|
export interface PublicExecutionContext {
|
|
17
|
-
|
|
18
|
-
current(): ExecutionIntent;
|
|
17
|
+
withIntent<T>(intent: ExecutionIntent, fn: () => Promise<T>): Promise<T>;
|
|
19
18
|
is(intent: ExecutionIntent): boolean;
|
|
19
|
+
withAbort<T>(signal: AbortSignal, fn: () => Promise<T>): Promise<T>;
|
|
20
|
+
currentSignal(): AbortSignal | null;
|
|
20
21
|
}
|
|
21
22
|
export interface PublicAsyncDuck<TParams, TResult> {
|
|
22
23
|
run(options?: RunOptions<TParams, TResult>): Promise<TResult | undefined>;
|
|
23
24
|
refresh(): Promise<TResult | undefined>;
|
|
25
|
+
cancel(): void;
|
|
24
26
|
readonly isLoading: boolean;
|
|
25
27
|
readonly isRetrying: boolean;
|
|
26
28
|
readonly isError: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-core-api.js","sourceRoot":"","sources":["../../../src/root/coreApi/create-core-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAU3C,MAAM,UAAU,aAAa,CAAsC,IAMlE;IACC,OAAO;QACL,SAAS,EAAE,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC;QAC7C,QAAQ,EAAE,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC;QAC1C,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC;QACpC,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,UAAU,EAAE,IAAI,CAAC,UAAU;
|
|
1
|
+
{"version":3,"file":"create-core-api.js","sourceRoot":"","sources":["../../../src/root/coreApi/create-core-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAU3C,MAAM,UAAU,aAAa,CAAsC,IAMlE;IACC,OAAO;QACL,SAAS,EAAE,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC;QAC7C,QAAQ,EAAE,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC;QAC1C,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC;QACpC,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,UAAU,EAAE,IAAI,CAAC,UAAU;KACG,CAAC;AACnC,CAAC"}
|
|
@@ -48,12 +48,14 @@ export type CoreGCAPI = {
|
|
|
48
48
|
bootstrap(): void;
|
|
49
49
|
processOrphan(): void;
|
|
50
50
|
};
|
|
51
|
-
export type
|
|
51
|
+
export type CoreAPIWithInternal<TStores = {}> = CoreAPI<TStores> & {
|
|
52
|
+
__internal: CoreInternalAPI;
|
|
53
|
+
};
|
|
54
|
+
export type CoreAPI<TStores = {}> = {
|
|
52
55
|
lifecycle: CoreLifecycleAPI;
|
|
53
56
|
entities: CoreEntitiesAPI;
|
|
54
57
|
stores: CoreStoresAPI<TStores>;
|
|
55
58
|
use<T>(key: PropertyKey): T | undefined;
|
|
56
|
-
__internal: CoreInternalAPI;
|
|
57
59
|
};
|
|
58
60
|
export type CoreEntitiesDeps = {
|
|
59
61
|
entities: TEntitiesStore;
|
package/dist/root/root-store.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { makeObservable, computed, action } from 'mobx';
|
|
2
2
|
import { createStore } from '../create';
|
|
3
3
|
import { EntityCleanerStore } from '../entities/cleaner';
|
|
4
4
|
import { COLLECTION_TAG, MULTI_COLLECTION_TAG, } from '../entities/collection/marker';
|
|
@@ -21,20 +21,14 @@ export class RootStore {
|
|
|
21
21
|
this.attachStoresToCore(this.storesRef);
|
|
22
22
|
this.buildServices(this.domainDeps);
|
|
23
23
|
this.setupPlugins();
|
|
24
|
-
this.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
storesRef: false,
|
|
33
|
-
_domainDeps: false,
|
|
34
|
-
_systemDeps: false,
|
|
35
|
-
_combinedDeps: false,
|
|
36
|
-
_decorators: false,
|
|
37
|
-
_isInitialized: true,
|
|
24
|
+
this.hidePrivateProperties();
|
|
25
|
+
makeObservable(this, {
|
|
26
|
+
isInitialized: computed,
|
|
27
|
+
setInitialized: action,
|
|
28
|
+
// NOTE:
|
|
29
|
+
// `isInitialized` is intentionally private.
|
|
30
|
+
// We use `as any` here to keep lifecycle accessible ONLY via Core API.
|
|
31
|
+
// Do NOT access RootStore lifecycle directly.
|
|
38
32
|
});
|
|
39
33
|
}
|
|
40
34
|
get isInitialized() {
|
|
@@ -146,35 +140,10 @@ export class RootStore {
|
|
|
146
140
|
buildServices(domainDeps) {
|
|
147
141
|
this.services = Object.fromEntries(Object.entries(this.deps.services).map(([key, ServiceClass]) => {
|
|
148
142
|
const instance = new ServiceClass(domainDeps);
|
|
149
|
-
Object.defineProperty(instance, 'deps', {
|
|
150
|
-
enumerable: false,
|
|
151
|
-
configurable: true,
|
|
152
|
-
writable: true,
|
|
153
|
-
});
|
|
154
143
|
return [key, instance];
|
|
155
144
|
}));
|
|
156
145
|
}
|
|
157
|
-
|
|
158
|
-
Object.defineProperty(this, 'deps', {
|
|
159
|
-
enumerable: false,
|
|
160
|
-
configurable: true,
|
|
161
|
-
writable: false,
|
|
162
|
-
});
|
|
163
|
-
Object.defineProperty(domainDeps, 'stores', {
|
|
164
|
-
enumerable: false,
|
|
165
|
-
configurable: true,
|
|
166
|
-
writable: false,
|
|
167
|
-
});
|
|
168
|
-
Object.defineProperty(domainDeps, 'services', {
|
|
169
|
-
enumerable: false,
|
|
170
|
-
configurable: true,
|
|
171
|
-
writable: false,
|
|
172
|
-
});
|
|
173
|
-
Object.defineProperty(domainDeps, 'core', {
|
|
174
|
-
enumerable: false,
|
|
175
|
-
configurable: true,
|
|
176
|
-
writable: false,
|
|
177
|
-
});
|
|
146
|
+
hidePrivateProperties() {
|
|
178
147
|
Object.defineProperty(this.core, '__internal', {
|
|
179
148
|
enumerable: false,
|
|
180
149
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"root-store.js","sourceRoot":"","sources":["../../src/root/root-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"root-store.js","sourceRoot":"","sources":["../../src/root/root-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EACL,cAAc,EACd,oBAAoB,GACrB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,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