@genesislcap/foundation-store 14.102.0 → 14.103.0-auth-mf.24
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -2
- package/dist/dts/store/errorMap.d.ts +3 -0
- package/dist/dts/store/errorMap.d.ts.map +1 -1
- package/dist/dts/store/foundationStore.d.ts +27 -1
- package/dist/dts/store/foundationStore.d.ts.map +1 -1
- package/dist/esm/store/foundationStore.js +39 -1
- package/dist/foundation-store.api.json +111 -4
- package/dist/foundation-store.d.ts +30 -1
- package/docs/api/foundation-store.abstractstore.invokeasyncapi.md +46 -0
- package/docs/api/foundation-store.abstractstore.md +1 -0
- package/docs/api/foundation-store.errordetailmap.md +4 -0
- package/docs/api/foundation-store.errormap.md +4 -0
- package/docs/api/foundation-store.errormaplogger.md +4 -0
- package/docs/api/foundation-store.registerstore.md +1 -1
- package/docs/api-report.md +4 -3
- package/package.json +6 -6
package/README.md
CHANGED
@@ -197,7 +197,7 @@ class DefaultStore extends AbstractStoreRoot<Store, StoreEventDetailMap, Interna
|
|
197
197
|
/**
|
198
198
|
* 10: Register the store which defines the DI key using the interface
|
199
199
|
*/
|
200
|
-
export const Store = registerStore(DefaultStore, 'RootStore');
|
200
|
+
export const Store = registerStore<Store>(DefaultStore, 'RootStore');
|
201
201
|
```
|
202
202
|
|
203
203
|
Your root store is now ready to be injected into your application. Hopefully the above gives you a good idea of general
|
@@ -225,7 +225,7 @@ class DefaultTradeEntryUI extends AbstractStore<TradeEntryUI, TradeEntryUIEventD
|
|
225
225
|
onOpen = this.createListener<boolean>('trade-entry-ui-open', detail => this.commit.isOpen = detail);
|
226
226
|
}
|
227
227
|
|
228
|
-
export const TradeEntryUI = registerStore(DefaultTradeEntryUI, 'TradeEntryUI');
|
228
|
+
export const TradeEntryUI = registerStore<TradeEntryUI>(DefaultTradeEntryUI, 'TradeEntryUI');
|
229
229
|
```
|
230
230
|
|
231
231
|
## Store events
|
@@ -1,12 +1,15 @@
|
|
1
1
|
/**
|
2
|
+
* @deprecated - Use `ErrorDetailMap` from `@genesislcap/foundation-utils` instead.
|
2
3
|
* @public
|
3
4
|
*/
|
4
5
|
export type ErrorDetailMap = Record<string, unknown>;
|
5
6
|
/**
|
7
|
+
* @deprecated - Use `ErrorMapLogger` from `@genesislcap/foundation-utils` instead.
|
6
8
|
* @public
|
7
9
|
*/
|
8
10
|
export type ErrorMapLogger = (...args: any[]) => void;
|
9
11
|
/**
|
12
|
+
* @deprecated - Use `ErrorMap` from `@genesislcap/foundation-utils` instead.
|
10
13
|
* @public
|
11
14
|
*/
|
12
15
|
export interface ErrorMap<TErrorDetailMap extends ErrorDetailMap> extends Pick<Map<keyof TErrorDetailMap, Error>, 'get' | 'has' | 'delete' | 'clear' | 'size'> {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"errorMap.d.ts","sourceRoot":"","sources":["../../../src/store/errorMap.ts"],"names":[],"mappings":"AAGA
|
1
|
+
{"version":3,"file":"errorMap.d.ts","sourceRoot":"","sources":["../../../src/store/errorMap.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAErD;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;AAEtD;;;GAGG;AACH,MAAM,WAAW,QAAQ,CAAC,eAAe,SAAS,cAAc,CAC9D,SAAQ,IAAI,CAAC,GAAG,CAAC,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;IAC5F;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B;;;;;;OAMG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,eAAe,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrD;AAqFD;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,mDACjB,cAAc,8BAOvB,CAAC"}
|
@@ -217,7 +217,7 @@ export type StoreBinding<TStore extends Store> = (store: TStore) => any;
|
|
217
217
|
*
|
218
218
|
* @example
|
219
219
|
* ```ts
|
220
|
-
* export const TradeEntry = registerStore(DefaultTradeEntry, 'TradeEntry');
|
220
|
+
* export const TradeEntry = registerStore<TradeEntry>(DefaultTradeEntry, 'TradeEntry');
|
221
221
|
* ```
|
222
222
|
*
|
223
223
|
* @public
|
@@ -411,6 +411,32 @@ export declare abstract class AbstractStore<TStore extends Store, TEventDetailMa
|
|
411
411
|
* fragments.
|
412
412
|
*/
|
413
413
|
protected emit<K extends keyof (TEventDetailMap & TInternalEventDetailMap) & string>(...args: (TEventDetailMap & TInternalEventDetailMap)[K] extends void ? [key: K] : [key: K, detail: (TEventDetailMap & TInternalEventDetailMap)[K]]): void;
|
414
|
+
/**
|
415
|
+
* A convenience method to invoke an async api and emit success and error events.
|
416
|
+
*
|
417
|
+
* @remarks
|
418
|
+
* The async api function should throw when it encounters an error.
|
419
|
+
*
|
420
|
+
* @example
|
421
|
+
* ```ts
|
422
|
+
* onLoad = this.createAsyncListener('domain-load', async () =>
|
423
|
+
* this.invokeAsyncAPI(
|
424
|
+
* async () => {
|
425
|
+
* !this.domainService.initialized && (await this.domainService.initialize(this.asDomainServiceInit()));
|
426
|
+
* return this.domainService.list();
|
427
|
+
* },
|
428
|
+
* 'domain-load-error',
|
429
|
+
* 'domain-load-success'
|
430
|
+
* )
|
431
|
+
* );
|
432
|
+
* ```
|
433
|
+
*
|
434
|
+
* @param api - The async service api function.
|
435
|
+
* @param error - The event key from the store fragment's event detail map.
|
436
|
+
* @param success - The event key from the store fragment's event detail map.
|
437
|
+
* @public
|
438
|
+
*/
|
439
|
+
protected invokeAsyncAPI<TResult>(api: () => Promise<TResult>, error: keyof (TEventDetailMap & TInternalEventDetailMap), success?: keyof (TEventDetailMap & TInternalEventDetailMap)): Promise<void>;
|
414
440
|
}
|
415
441
|
/**
|
416
442
|
* Store root event key to event det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,CAAC,CAAC,GACR,CAAC,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,eAAe,GAAG,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC,GACnE,IAAI;IAWP;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;cACa,cAAc,CAAC,OAAO,EACpC,GAAG,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,EAC3B,KAAK,EAAE,MAAM,CAAC,eAAe,GAAG,uBAAuB,CAAC,EACxD,OAAO,CAAC,EAAE,MAAM,CAAC,eAAe,GAAG,uBAAuB,CAAC;CAW9D;AAED;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC,iBAAiB,EAAE,WAAW,CAAC;IAC/B,oBAAoB,EAAE,IAAI,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF;;;;;;;GAOG;AACH,8BAAsB,iBAAiB,CACnC,MAAM,SAAS,SAAS,EACxB,eAAe,SAAS,uBAAuB,GAAG,uBAAuB,EACzE,uBAAuB,SAAS,cAAc,GAAG,eAAe,CAElE,SAAQ,aAAa,CAAC,MAAM,EAAE,eAAe,EAAE,uBAAuB,CACtE,YAAW,SAAS;IAEpB,oCAAoC;IACxB,KAAK,EAAE,OAAO,CAAS;IAEnC,sCAAsC;IAC1B,OAAO,EAAE,WAAW,CAAC;IAEjC;;;;OAIG;IACH,SAAS,CAAC,IAAI,OAAQ;IAEtB;;;;;;;;OAQG;IACH,OAAO,CAAC,cAAc;IAWtB,WAAW,gBAGT;IACF,cAAc,gBAGZ;IACF,OAAO,gBAAuF;CAC/F"}
|
@@ -25,7 +25,7 @@ const getBindArgs = (...args) => {
|
|
25
25
|
*
|
26
26
|
* @example
|
27
27
|
* ```ts
|
28
|
-
* export const TradeEntry = registerStore(DefaultTradeEntry, 'TradeEntry');
|
28
|
+
* export const TradeEntry = registerStore<TradeEntry>(DefaultTradeEntry, 'TradeEntry');
|
29
29
|
* ```
|
30
30
|
*
|
31
31
|
* @public
|
@@ -317,6 +317,44 @@ export class AbstractStore {
|
|
317
317
|
}
|
318
318
|
this.root.element.dispatchEvent(new CustomEvent(key, Object.assign({ detail }, internalEmitOptions)));
|
319
319
|
}
|
320
|
+
/**
|
321
|
+
* A convenience method to invoke an async api and emit success and error events.
|
322
|
+
*
|
323
|
+
* @remarks
|
324
|
+
* The async api function should throw when it encounters an error.
|
325
|
+
*
|
326
|
+
* @example
|
327
|
+
* ```ts
|
328
|
+
* onLoad = this.createAsyncListener('domain-load', async () =>
|
329
|
+
* this.invokeAsyncAPI(
|
330
|
+
* async () => {
|
331
|
+
* !this.domainService.initialized && (await this.domainService.initialize(this.asDomainServiceInit()));
|
332
|
+
* return this.domainService.list();
|
333
|
+
* },
|
334
|
+
* 'domain-load-error',
|
335
|
+
* 'domain-load-success'
|
336
|
+
* )
|
337
|
+
* );
|
338
|
+
* ```
|
339
|
+
*
|
340
|
+
* @param api - The async service api function.
|
341
|
+
* @param error - The event key from the store fragment's event detail map.
|
342
|
+
* @param success - The event key from the store fragment's event detail map.
|
343
|
+
* @public
|
344
|
+
*/
|
345
|
+
invokeAsyncAPI(api, error, success) {
|
346
|
+
return __awaiter(this, void 0, void 0, function* () {
|
347
|
+
try {
|
348
|
+
const result = yield api();
|
349
|
+
// @ts-ignore (we know more about this than ts)
|
350
|
+
success && this.emit(success, result);
|
351
|
+
}
|
352
|
+
catch (e) {
|
353
|
+
// @ts-ignore (we know more about this than ts)
|
354
|
+
this.emit(error, e);
|
355
|
+
}
|
356
|
+
});
|
357
|
+
}
|
320
358
|
}
|
321
359
|
/**
|
322
360
|
* The abstract store root that concrete store roots must extend.
|
@@ -1103,6 +1103,113 @@
|
|
1103
1103
|
"isProtected": false,
|
1104
1104
|
"isAbstract": false
|
1105
1105
|
},
|
1106
|
+
{
|
1107
|
+
"kind": "Method",
|
1108
|
+
"canonicalReference": "@genesislcap/foundation-store!AbstractStore#invokeAsyncAPI:member(1)",
|
1109
|
+
"docComment": "/**\n * A convenience method to invoke an async api and emit success and error events.\n *\n * @remarks\n *\n * The async api function should throw when it encounters an error.\n *\n * @param api - The async service api function.\n *\n * @param error - The event key from the store fragment's event detail map.\n *\n * @param success - The event key from the store fragment's event detail map.\n *\n * @example\n * ```ts\n * onLoad = this.createAsyncListener('domain-load', async () =>\n * this.invokeAsyncAPI(\n * async () => {\n * !this.domainService.initialized && (await this.domainService.initialize(this.asDomainServiceInit()));\n * return this.domainService.list();\n * },\n * 'domain-load-error',\n * 'domain-load-success'\n * )\n * );\n * ```\n *\n * @public\n */\n",
|
1110
|
+
"excerptTokens": [
|
1111
|
+
{
|
1112
|
+
"kind": "Content",
|
1113
|
+
"text": "protected invokeAsyncAPI<TResult>(api: "
|
1114
|
+
},
|
1115
|
+
{
|
1116
|
+
"kind": "Content",
|
1117
|
+
"text": "() => "
|
1118
|
+
},
|
1119
|
+
{
|
1120
|
+
"kind": "Reference",
|
1121
|
+
"text": "Promise",
|
1122
|
+
"canonicalReference": "!Promise:interface"
|
1123
|
+
},
|
1124
|
+
{
|
1125
|
+
"kind": "Content",
|
1126
|
+
"text": "<TResult>"
|
1127
|
+
},
|
1128
|
+
{
|
1129
|
+
"kind": "Content",
|
1130
|
+
"text": ", error: "
|
1131
|
+
},
|
1132
|
+
{
|
1133
|
+
"kind": "Content",
|
1134
|
+
"text": "keyof (TEventDetailMap & TInternalEventDetailMap)"
|
1135
|
+
},
|
1136
|
+
{
|
1137
|
+
"kind": "Content",
|
1138
|
+
"text": ", success?: "
|
1139
|
+
},
|
1140
|
+
{
|
1141
|
+
"kind": "Content",
|
1142
|
+
"text": "keyof (TEventDetailMap & TInternalEventDetailMap)"
|
1143
|
+
},
|
1144
|
+
{
|
1145
|
+
"kind": "Content",
|
1146
|
+
"text": "): "
|
1147
|
+
},
|
1148
|
+
{
|
1149
|
+
"kind": "Reference",
|
1150
|
+
"text": "Promise",
|
1151
|
+
"canonicalReference": "!Promise:interface"
|
1152
|
+
},
|
1153
|
+
{
|
1154
|
+
"kind": "Content",
|
1155
|
+
"text": "<void>"
|
1156
|
+
},
|
1157
|
+
{
|
1158
|
+
"kind": "Content",
|
1159
|
+
"text": ";"
|
1160
|
+
}
|
1161
|
+
],
|
1162
|
+
"typeParameters": [
|
1163
|
+
{
|
1164
|
+
"typeParameterName": "TResult",
|
1165
|
+
"constraintTokenRange": {
|
1166
|
+
"startIndex": 0,
|
1167
|
+
"endIndex": 0
|
1168
|
+
},
|
1169
|
+
"defaultTypeTokenRange": {
|
1170
|
+
"startIndex": 0,
|
1171
|
+
"endIndex": 0
|
1172
|
+
}
|
1173
|
+
}
|
1174
|
+
],
|
1175
|
+
"isStatic": false,
|
1176
|
+
"returnTypeTokenRange": {
|
1177
|
+
"startIndex": 9,
|
1178
|
+
"endIndex": 11
|
1179
|
+
},
|
1180
|
+
"releaseTag": "Public",
|
1181
|
+
"isProtected": true,
|
1182
|
+
"overloadIndex": 1,
|
1183
|
+
"parameters": [
|
1184
|
+
{
|
1185
|
+
"parameterName": "api",
|
1186
|
+
"parameterTypeTokenRange": {
|
1187
|
+
"startIndex": 1,
|
1188
|
+
"endIndex": 4
|
1189
|
+
},
|
1190
|
+
"isOptional": false
|
1191
|
+
},
|
1192
|
+
{
|
1193
|
+
"parameterName": "error",
|
1194
|
+
"parameterTypeTokenRange": {
|
1195
|
+
"startIndex": 5,
|
1196
|
+
"endIndex": 6
|
1197
|
+
},
|
1198
|
+
"isOptional": false
|
1199
|
+
},
|
1200
|
+
{
|
1201
|
+
"parameterName": "success",
|
1202
|
+
"parameterTypeTokenRange": {
|
1203
|
+
"startIndex": 7,
|
1204
|
+
"endIndex": 8
|
1205
|
+
},
|
1206
|
+
"isOptional": true
|
1207
|
+
}
|
1208
|
+
],
|
1209
|
+
"isOptional": false,
|
1210
|
+
"isAbstract": false,
|
1211
|
+
"name": "invokeAsyncAPI"
|
1212
|
+
},
|
1106
1213
|
{
|
1107
1214
|
"kind": "Property",
|
1108
1215
|
"canonicalReference": "@genesislcap/foundation-store!AbstractStore#name:member",
|
@@ -1537,7 +1644,7 @@
|
|
1537
1644
|
{
|
1538
1645
|
"kind": "TypeAlias",
|
1539
1646
|
"canonicalReference": "@genesislcap/foundation-store!ErrorDetailMap:type",
|
1540
|
-
"docComment": "/**\n * @public\n */\n",
|
1647
|
+
"docComment": "/**\n * @deprecated\n *\n * - Use `ErrorDetailMap` from `@genesislcap/foundation-utils` instead.\n *\n * @public\n */\n",
|
1541
1648
|
"excerptTokens": [
|
1542
1649
|
{
|
1543
1650
|
"kind": "Content",
|
@@ -1568,7 +1675,7 @@
|
|
1568
1675
|
{
|
1569
1676
|
"kind": "Interface",
|
1570
1677
|
"canonicalReference": "@genesislcap/foundation-store!ErrorMap:interface",
|
1571
|
-
"docComment": "/**\n * @public\n */\n",
|
1678
|
+
"docComment": "/**\n * @deprecated\n *\n * - Use `ErrorMap` from `@genesislcap/foundation-utils` instead.\n *\n * @public\n */\n",
|
1572
1679
|
"excerptTokens": [
|
1573
1680
|
{
|
1574
1681
|
"kind": "Content",
|
@@ -1733,7 +1840,7 @@
|
|
1733
1840
|
{
|
1734
1841
|
"kind": "TypeAlias",
|
1735
1842
|
"canonicalReference": "@genesislcap/foundation-store!ErrorMapLogger:type",
|
1736
|
-
"docComment": "/**\n * @public\n */\n",
|
1843
|
+
"docComment": "/**\n * @deprecated\n *\n * - Use `ErrorMapLogger` from `@genesislcap/foundation-utils` instead.\n *\n * @public\n */\n",
|
1737
1844
|
"excerptTokens": [
|
1738
1845
|
{
|
1739
1846
|
"kind": "Content",
|
@@ -1759,7 +1866,7 @@
|
|
1759
1866
|
{
|
1760
1867
|
"kind": "Variable",
|
1761
1868
|
"canonicalReference": "@genesislcap/foundation-store!registerStore:var",
|
1762
|
-
"docComment": "/**\n * Creates a dependency injection key for the store being registered.\n *\n * @param Base - The store fragment class.\n *\n * @param name - The name of your store fragment, mostly used for internal logging.\n *\n * @returns The created key.\n *\n * @example\n * ```ts\n * export const TradeEntry = registerStore(DefaultTradeEntry, 'TradeEntry');\n * ```\n *\n * @public\n */\n",
|
1869
|
+
"docComment": "/**\n * Creates a dependency injection key for the store being registered.\n *\n * @param Base - The store fragment class.\n *\n * @param name - The name of your store fragment, mostly used for internal logging.\n *\n * @returns The created key.\n *\n * @example\n * ```ts\n * export const TradeEntry = registerStore<TradeEntry>(DefaultTradeEntry, 'TradeEntry');\n * ```\n *\n * @public\n */\n",
|
1763
1870
|
"excerptTokens": [
|
1764
1871
|
{
|
1765
1872
|
"kind": "Content",
|
@@ -195,6 +195,32 @@ export declare abstract class AbstractStore<TStore extends Store, TEventDetailMa
|
|
195
195
|
* fragments.
|
196
196
|
*/
|
197
197
|
protected emit<K extends keyof (TEventDetailMap & TInternalEventDetailMap) & string>(...args: (TEventDetailMap & TInternalEventDetailMap)[K] extends void ? [key: K] : [key: K, detail: (TEventDetailMap & TInternalEventDetailMap)[K]]): void;
|
198
|
+
/**
|
199
|
+
* A convenience method to invoke an async api and emit success and error events.
|
200
|
+
*
|
201
|
+
* @remarks
|
202
|
+
* The async api function should throw when it encounters an error.
|
203
|
+
*
|
204
|
+
* @example
|
205
|
+
* ```ts
|
206
|
+
* onLoad = this.createAsyncListener('domain-load', async () =>
|
207
|
+
* this.invokeAsyncAPI(
|
208
|
+
* async () => {
|
209
|
+
* !this.domainService.initialized && (await this.domainService.initialize(this.asDomainServiceInit()));
|
210
|
+
* return this.domainService.list();
|
211
|
+
* },
|
212
|
+
* 'domain-load-error',
|
213
|
+
* 'domain-load-success'
|
214
|
+
* )
|
215
|
+
* );
|
216
|
+
* ```
|
217
|
+
*
|
218
|
+
* @param api - The async service api function.
|
219
|
+
* @param error - The event key from the store fragment's event detail map.
|
220
|
+
* @param success - The event key from the store fragment's event detail map.
|
221
|
+
* @public
|
222
|
+
*/
|
223
|
+
protected invokeAsyncAPI<TResult>(api: () => Promise<TResult>, error: keyof (TEventDetailMap & TInternalEventDetailMap), success?: keyof (TEventDetailMap & TInternalEventDetailMap)): Promise<void>;
|
198
224
|
}
|
199
225
|
|
200
226
|
/**
|
@@ -242,11 +268,13 @@ export declare abstract class AbstractStoreRoot<TStore extends StoreRoot, TEvent
|
|
242
268
|
export declare const createErrorMap: <TErrorDetailMap extends ErrorDetailMap>(logger: ErrorMapLogger) => ErrorMap<TErrorDetailMap>;
|
243
269
|
|
244
270
|
/**
|
271
|
+
* @deprecated - Use `ErrorDetailMap` from `@genesislcap/foundation-utils` instead.
|
245
272
|
* @public
|
246
273
|
*/
|
247
274
|
export declare type ErrorDetailMap = Record<string, unknown>;
|
248
275
|
|
249
276
|
/**
|
277
|
+
* @deprecated - Use `ErrorMap` from `@genesislcap/foundation-utils` instead.
|
250
278
|
* @public
|
251
279
|
*/
|
252
280
|
export declare interface ErrorMap<TErrorDetailMap extends ErrorDetailMap> extends Pick<Map<keyof TErrorDetailMap, Error>, 'get' | 'has' | 'delete' | 'clear' | 'size'> {
|
@@ -268,6 +296,7 @@ export declare interface ErrorMap<TErrorDetailMap extends ErrorDetailMap> extend
|
|
268
296
|
}
|
269
297
|
|
270
298
|
/**
|
299
|
+
* @deprecated - Use `ErrorMapLogger` from `@genesislcap/foundation-utils` instead.
|
271
300
|
* @public
|
272
301
|
*/
|
273
302
|
export declare type ErrorMapLogger = (...args: any[]) => void;
|
@@ -280,7 +309,7 @@ export declare type ErrorMapLogger = (...args: any[]) => void;
|
|
280
309
|
*
|
281
310
|
* @example
|
282
311
|
* ```ts
|
283
|
-
* export const TradeEntry = registerStore(DefaultTradeEntry, 'TradeEntry');
|
312
|
+
* export const TradeEntry = registerStore<TradeEntry>(DefaultTradeEntry, 'TradeEntry');
|
284
313
|
* ```
|
285
314
|
*
|
286
315
|
* @public
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
2
|
+
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-store](./foundation-store.md) > [AbstractStore](./foundation-store.abstractstore.md) > [invokeAsyncAPI](./foundation-store.abstractstore.invokeasyncapi.md)
|
4
|
+
|
5
|
+
## AbstractStore.invokeAsyncAPI() method
|
6
|
+
|
7
|
+
A convenience method to invoke an async api and emit success and error events.
|
8
|
+
|
9
|
+
**Signature:**
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
protected invokeAsyncAPI<TResult>(api: () => Promise<TResult>, error: keyof (TEventDetailMap & TInternalEventDetailMap), success?: keyof (TEventDetailMap & TInternalEventDetailMap)): Promise<void>;
|
13
|
+
```
|
14
|
+
|
15
|
+
## Parameters
|
16
|
+
|
17
|
+
| Parameter | Type | Description |
|
18
|
+
| --- | --- | --- |
|
19
|
+
| api | () => Promise<TResult> | The async service api function. |
|
20
|
+
| error | keyof (TEventDetailMap & TInternalEventDetailMap) | The event key from the store fragment's event detail map. |
|
21
|
+
| success | keyof (TEventDetailMap & TInternalEventDetailMap) | _(Optional)_ The event key from the store fragment's event detail map. |
|
22
|
+
|
23
|
+
**Returns:**
|
24
|
+
|
25
|
+
Promise<void>
|
26
|
+
|
27
|
+
## Remarks
|
28
|
+
|
29
|
+
The async api function should throw when it encounters an error.
|
30
|
+
|
31
|
+
## Example
|
32
|
+
|
33
|
+
|
34
|
+
```ts
|
35
|
+
onLoad = this.createAsyncListener('domain-load', async () =>
|
36
|
+
this.invokeAsyncAPI(
|
37
|
+
async () => {
|
38
|
+
!this.domainService.initialized && (await this.domainService.initialize(this.asDomainServiceInit()));
|
39
|
+
return this.domainService.list();
|
40
|
+
},
|
41
|
+
'domain-load-error',
|
42
|
+
'domain-load-success'
|
43
|
+
)
|
44
|
+
);
|
45
|
+
```
|
46
|
+
|
@@ -43,4 +43,5 @@ export declare abstract class AbstractStore<TStore extends Store, TEventDetailMa
|
|
43
43
|
| [connect(root)](./foundation-store.abstractstore.connect.md) | | Connects this store fragment. |
|
44
44
|
| [disconnect(root)](./foundation-store.abstractstore.disconnect.md) | | Disconnects this store fragment. |
|
45
45
|
| [emit(args)](./foundation-store.abstractstore.emit.md) | <code>protected</code> | Emit events to the stores directly via the standard event flow. |
|
46
|
+
| [invokeAsyncAPI(api, error, success)](./foundation-store.abstractstore.invokeasyncapi.md) | <code>protected</code> | A convenience method to invoke an async api and emit success and error events. |
|
46
47
|
|
@@ -16,6 +16,6 @@ registerStore: <K extends Key>(Base: Constructable<Store>, name?: string) => imp
|
|
16
16
|
|
17
17
|
|
18
18
|
```ts
|
19
|
-
export const TradeEntry = registerStore(DefaultTradeEntry, 'TradeEntry');
|
19
|
+
export const TradeEntry = registerStore<TradeEntry>(DefaultTradeEntry, 'TradeEntry');
|
20
20
|
```
|
21
21
|
|
package/docs/api-report.md
CHANGED
@@ -48,6 +48,7 @@ export abstract class AbstractStore<TStore extends Store, TEventDetailMap extend
|
|
48
48
|
protected disconnectStoreFragments(root: TStoreRoot): void;
|
49
49
|
protected emit<K extends keyof (TEventDetailMap & TInternalEventDetailMap) & string>(...args: (TEventDetailMap & TInternalEventDetailMap)[K] extends void ? [key: K] : [key: K, detail: (TEventDetailMap & TInternalEventDetailMap)[K]]): void;
|
50
50
|
errors: ErrorMap_2<TEventDetailMap & TInternalEventDetailMap>;
|
51
|
+
protected invokeAsyncAPI<TResult>(api: () => Promise<TResult>, error: keyof (TEventDetailMap & TInternalEventDetailMap), success?: keyof (TEventDetailMap & TInternalEventDetailMap)): Promise<void>;
|
51
52
|
get name(): string;
|
52
53
|
// @internal
|
53
54
|
protected removeEventListeners(element: HTMLElement): void;
|
@@ -73,16 +74,16 @@ export abstract class AbstractStoreRoot<TStore extends StoreRoot, TEventDetailMa
|
|
73
74
|
// @public @deprecated
|
74
75
|
export const createErrorMap: <TErrorDetailMap extends ErrorDetailMap>(logger: ErrorMapLogger) => ErrorMap<TErrorDetailMap>;
|
75
76
|
|
76
|
-
// @public (undocumented)
|
77
|
+
// @public @deprecated (undocumented)
|
77
78
|
export type ErrorDetailMap = Record<string, unknown>;
|
78
79
|
|
79
|
-
// @public (undocumented)
|
80
|
+
// @public @deprecated (undocumented)
|
80
81
|
export interface ErrorMap<TErrorDetailMap extends ErrorDetailMap> extends Pick<Map<keyof TErrorDetailMap, Error>, 'get' | 'has' | 'delete' | 'clear' | 'size'> {
|
81
82
|
readonly messages: string;
|
82
83
|
set(key: keyof TErrorDetailMap, error: Error): void;
|
83
84
|
}
|
84
85
|
|
85
|
-
// @public (undocumented)
|
86
|
+
// @public @deprecated (undocumented)
|
86
87
|
export type ErrorMapLogger = (...args: any[]) => void;
|
87
88
|
|
88
89
|
// @public
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@genesislcap/foundation-store",
|
3
3
|
"description": "Genesis Foundation Store",
|
4
|
-
"version": "14.
|
4
|
+
"version": "14.103.0-auth-mf.24",
|
5
5
|
"sideEffects": false,
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
7
7
|
"main": "dist/esm/index.js",
|
@@ -25,13 +25,13 @@
|
|
25
25
|
"serve": "genx serve"
|
26
26
|
},
|
27
27
|
"devDependencies": {
|
28
|
-
"@genesislcap/genx": "14.
|
28
|
+
"@genesislcap/genx": "14.103.0-auth-mf.24",
|
29
29
|
"rimraf": "^3.0.2"
|
30
30
|
},
|
31
31
|
"dependencies": {
|
32
|
-
"@genesislcap/foundation-events": "14.
|
33
|
-
"@genesislcap/foundation-logger": "14.
|
34
|
-
"@genesislcap/foundation-utils": "14.
|
32
|
+
"@genesislcap/foundation-events": "14.103.0-auth-mf.24",
|
33
|
+
"@genesislcap/foundation-logger": "14.103.0-auth-mf.24",
|
34
|
+
"@genesislcap/foundation-utils": "14.103.0-auth-mf.24",
|
35
35
|
"@microsoft/fast-element": "^1.7.0",
|
36
36
|
"@microsoft/fast-foundation": "^2.33.2",
|
37
37
|
"fast-safe-stringify": "^2.1.1",
|
@@ -46,5 +46,5 @@
|
|
46
46
|
"publishConfig": {
|
47
47
|
"access": "public"
|
48
48
|
},
|
49
|
-
"gitHead": "
|
49
|
+
"gitHead": "0ecbee6397572e9daf901d0560d465b653440f52"
|
50
50
|
}
|