@genesislcap/foundation-store 14.103.0-auth-mf.23 → 14.103.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/README.md +2 -2
- package/dist/dts/store/errorMap.d.ts +0 -3
- package/dist/dts/store/errorMap.d.ts.map +1 -1
- package/dist/dts/store/foundationStore.d.ts +1 -27
- package/dist/dts/store/foundationStore.d.ts.map +1 -1
- package/dist/esm/store/foundationStore.js +1 -39
- package/dist/foundation-store.api.json +4 -111
- package/dist/foundation-store.d.ts +1 -30
- package/docs/api/foundation-store.abstractstore.md +0 -1
- package/docs/api/foundation-store.errordetailmap.md +0 -4
- package/docs/api/foundation-store.errormap.md +0 -4
- package/docs/api/foundation-store.errormaplogger.md +0 -4
- package/docs/api/foundation-store.registerstore.md +1 -1
- package/docs/api-report.md +3 -4
- package/package.json +6 -6
- package/docs/api/foundation-store.abstractstore.invokeasyncapi.md +0 -46
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
|
|
200
|
+
export const Store = registerStore(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
|
|
228
|
+
export const TradeEntryUI = registerStore(DefaultTradeEntryUI, 'TradeEntryUI');
|
|
229
229
|
```
|
|
230
230
|
|
|
231
231
|
## Store events
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @deprecated - Use `ErrorDetailMap` from `@genesislcap/foundation-utils` instead.
|
|
3
2
|
* @public
|
|
4
3
|
*/
|
|
5
4
|
export type ErrorDetailMap = Record<string, unknown>;
|
|
6
5
|
/**
|
|
7
|
-
* @deprecated - Use `ErrorMapLogger` from `@genesislcap/foundation-utils` instead.
|
|
8
6
|
* @public
|
|
9
7
|
*/
|
|
10
8
|
export type ErrorMapLogger = (...args: any[]) => void;
|
|
11
9
|
/**
|
|
12
|
-
* @deprecated - Use `ErrorMap` from `@genesislcap/foundation-utils` instead.
|
|
13
10
|
* @public
|
|
14
11
|
*/
|
|
15
12
|
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;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAErD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;AAEtD;;GAEG;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
|
|
220
|
+
* export const TradeEntry = registerStore(DefaultTradeEntry, 'TradeEntry');
|
|
221
221
|
* ```
|
|
222
222
|
*
|
|
223
223
|
* @public
|
|
@@ -411,32 +411,6 @@ 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>;
|
|
440
414
|
}
|
|
441
415
|
/**
|
|
442
416
|
* Store root event key to event detail map.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"foundationStore.d.ts","sourceRoot":"","sources":["../../../src/store/foundationStore.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAkB,QAAQ,EAAS,MAAM,+BAA+B,CAAC;AAChF,OAAO,EACL,eAAe,EACf,aAAa,EAEb,gBAAgB,EAGjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAM,GAAG,EAAE,MAAM,4BAA4B,CAAC;AAErD,OAAO,EAAE,UAAU,IAAI,YAAY,EAAM,MAAM,MAAM,CAAC;AAItD;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,CAAC,OAAO,GAAG,GAAG,IAAI,CACpD,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,eAAe,KAClB,IAAI,CAAC;AAEV;;;;;;GAMG;AACH,MAAM,WAAW,KAAK;IACpB;;;;;;;OAOG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;;;;;;;;;;;;;OAgBG;IACH,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;IAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgDG;IACH,OAAO,CAAC,OAAO,GAAG,GAAG,EAAE,OAAO,GAAG,GAAG,EAClC,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,IAAI,KAAK,OAAO,CAAC,GAAG,MAAM,IAAI,EAC9C,wBAAwB,CAAC,EAAE,wBAAwB,CAAC,OAAO,CAAC,GAAG,SAAS,EACxE,iBAAiB,CAAC,EAAE,OAAO,EAC3B,OAAO,CAAC,EAAE,gBAAg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,eAAe,GAAG,uBAAuB,CAAC,GAAG,MAAM,EACjF,GAAG,IAAI,EAAE,CAAC,eAAe,GAAG,uBAAuB,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GAChE,CAAC,GAAG,EAAE,CAAC,CAAC,GACR,CAAC,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,eAAe,GAAG,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC,GACnE,IAAI;CAUR;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
|
|
28
|
+
* export const TradeEntry = registerStore(DefaultTradeEntry, 'TradeEntry');
|
|
29
29
|
* ```
|
|
30
30
|
*
|
|
31
31
|
* @public
|
|
@@ -317,44 +317,6 @@ 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
|
-
}
|
|
358
320
|
}
|
|
359
321
|
/**
|
|
360
322
|
* The abstract store root that concrete store roots must extend.
|
|
@@ -1103,113 +1103,6 @@
|
|
|
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
|
-
},
|
|
1213
1106
|
{
|
|
1214
1107
|
"kind": "Property",
|
|
1215
1108
|
"canonicalReference": "@genesislcap/foundation-store!AbstractStore#name:member",
|
|
@@ -1644,7 +1537,7 @@
|
|
|
1644
1537
|
{
|
|
1645
1538
|
"kind": "TypeAlias",
|
|
1646
1539
|
"canonicalReference": "@genesislcap/foundation-store!ErrorDetailMap:type",
|
|
1647
|
-
"docComment": "/**\n * @
|
|
1540
|
+
"docComment": "/**\n * @public\n */\n",
|
|
1648
1541
|
"excerptTokens": [
|
|
1649
1542
|
{
|
|
1650
1543
|
"kind": "Content",
|
|
@@ -1675,7 +1568,7 @@
|
|
|
1675
1568
|
{
|
|
1676
1569
|
"kind": "Interface",
|
|
1677
1570
|
"canonicalReference": "@genesislcap/foundation-store!ErrorMap:interface",
|
|
1678
|
-
"docComment": "/**\n * @
|
|
1571
|
+
"docComment": "/**\n * @public\n */\n",
|
|
1679
1572
|
"excerptTokens": [
|
|
1680
1573
|
{
|
|
1681
1574
|
"kind": "Content",
|
|
@@ -1840,7 +1733,7 @@
|
|
|
1840
1733
|
{
|
|
1841
1734
|
"kind": "TypeAlias",
|
|
1842
1735
|
"canonicalReference": "@genesislcap/foundation-store!ErrorMapLogger:type",
|
|
1843
|
-
"docComment": "/**\n * @
|
|
1736
|
+
"docComment": "/**\n * @public\n */\n",
|
|
1844
1737
|
"excerptTokens": [
|
|
1845
1738
|
{
|
|
1846
1739
|
"kind": "Content",
|
|
@@ -1866,7 +1759,7 @@
|
|
|
1866
1759
|
{
|
|
1867
1760
|
"kind": "Variable",
|
|
1868
1761
|
"canonicalReference": "@genesislcap/foundation-store!registerStore:var",
|
|
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
|
|
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",
|
|
1870
1763
|
"excerptTokens": [
|
|
1871
1764
|
{
|
|
1872
1765
|
"kind": "Content",
|
|
@@ -195,32 +195,6 @@ 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>;
|
|
224
198
|
}
|
|
225
199
|
|
|
226
200
|
/**
|
|
@@ -268,13 +242,11 @@ export declare abstract class AbstractStoreRoot<TStore extends StoreRoot, TEvent
|
|
|
268
242
|
export declare const createErrorMap: <TErrorDetailMap extends ErrorDetailMap>(logger: ErrorMapLogger) => ErrorMap<TErrorDetailMap>;
|
|
269
243
|
|
|
270
244
|
/**
|
|
271
|
-
* @deprecated - Use `ErrorDetailMap` from `@genesislcap/foundation-utils` instead.
|
|
272
245
|
* @public
|
|
273
246
|
*/
|
|
274
247
|
export declare type ErrorDetailMap = Record<string, unknown>;
|
|
275
248
|
|
|
276
249
|
/**
|
|
277
|
-
* @deprecated - Use `ErrorMap` from `@genesislcap/foundation-utils` instead.
|
|
278
250
|
* @public
|
|
279
251
|
*/
|
|
280
252
|
export declare interface ErrorMap<TErrorDetailMap extends ErrorDetailMap> extends Pick<Map<keyof TErrorDetailMap, Error>, 'get' | 'has' | 'delete' | 'clear' | 'size'> {
|
|
@@ -296,7 +268,6 @@ export declare interface ErrorMap<TErrorDetailMap extends ErrorDetailMap> extend
|
|
|
296
268
|
}
|
|
297
269
|
|
|
298
270
|
/**
|
|
299
|
-
* @deprecated - Use `ErrorMapLogger` from `@genesislcap/foundation-utils` instead.
|
|
300
271
|
* @public
|
|
301
272
|
*/
|
|
302
273
|
export declare type ErrorMapLogger = (...args: any[]) => void;
|
|
@@ -309,7 +280,7 @@ export declare type ErrorMapLogger = (...args: any[]) => void;
|
|
|
309
280
|
*
|
|
310
281
|
* @example
|
|
311
282
|
* ```ts
|
|
312
|
-
* export const TradeEntry = registerStore
|
|
283
|
+
* export const TradeEntry = registerStore(DefaultTradeEntry, 'TradeEntry');
|
|
313
284
|
* ```
|
|
314
285
|
*
|
|
315
286
|
* @public
|
|
@@ -43,5 +43,4 @@ 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. |
|
|
47
46
|
|
|
@@ -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
|
|
19
|
+
export const TradeEntry = registerStore(DefaultTradeEntry, 'TradeEntry');
|
|
20
20
|
```
|
|
21
21
|
|
package/docs/api-report.md
CHANGED
|
@@ -48,7 +48,6 @@ 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>;
|
|
52
51
|
get name(): string;
|
|
53
52
|
// @internal
|
|
54
53
|
protected removeEventListeners(element: HTMLElement): void;
|
|
@@ -74,16 +73,16 @@ export abstract class AbstractStoreRoot<TStore extends StoreRoot, TEventDetailMa
|
|
|
74
73
|
// @public @deprecated
|
|
75
74
|
export const createErrorMap: <TErrorDetailMap extends ErrorDetailMap>(logger: ErrorMapLogger) => ErrorMap<TErrorDetailMap>;
|
|
76
75
|
|
|
77
|
-
// @public
|
|
76
|
+
// @public (undocumented)
|
|
78
77
|
export type ErrorDetailMap = Record<string, unknown>;
|
|
79
78
|
|
|
80
|
-
// @public
|
|
79
|
+
// @public (undocumented)
|
|
81
80
|
export interface ErrorMap<TErrorDetailMap extends ErrorDetailMap> extends Pick<Map<keyof TErrorDetailMap, Error>, 'get' | 'has' | 'delete' | 'clear' | 'size'> {
|
|
82
81
|
readonly messages: string;
|
|
83
82
|
set(key: keyof TErrorDetailMap, error: Error): void;
|
|
84
83
|
}
|
|
85
84
|
|
|
86
|
-
// @public
|
|
85
|
+
// @public (undocumented)
|
|
87
86
|
export type ErrorMapLogger = (...args: any[]) => void;
|
|
88
87
|
|
|
89
88
|
// @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.103.0
|
|
4
|
+
"version": "14.103.0",
|
|
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.103.0
|
|
28
|
+
"@genesislcap/genx": "14.103.0",
|
|
29
29
|
"rimraf": "^3.0.2"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@genesislcap/foundation-events": "14.103.0
|
|
33
|
-
"@genesislcap/foundation-logger": "14.103.0
|
|
34
|
-
"@genesislcap/foundation-utils": "14.103.0
|
|
32
|
+
"@genesislcap/foundation-events": "14.103.0",
|
|
33
|
+
"@genesislcap/foundation-logger": "14.103.0",
|
|
34
|
+
"@genesislcap/foundation-utils": "14.103.0",
|
|
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": "a2f0a1825fe66db9433563c30c256414762f4155"
|
|
50
50
|
}
|
|
@@ -1,46 +0,0 @@
|
|
|
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
|
-
|