@adaas/a-utils 0.2.6 → 0.2.7
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaas/a-utils",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"description": "A-Utils is a set of utilities that are used across the ADAAS ecosystem. This package is designed to be a collection of utilities that are used across the ADAAS ecosystem.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
"build": "tsup --config tsup.config.ts"
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
|
-
"@adaas/a-concept": "^0.2.
|
|
84
|
-
"@adaas/a-frame": "^0.0.
|
|
83
|
+
"@adaas/a-concept": "^0.2.7",
|
|
84
|
+
"@adaas/a-frame": "^0.0.8"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@types/chai": "^4.3.14",
|
|
@@ -61,7 +61,23 @@ export class A_StateMachine<
|
|
|
61
61
|
*/
|
|
62
62
|
get ready(): Promise<void> {
|
|
63
63
|
if (!this._initialized) {
|
|
64
|
-
this._initialized =
|
|
64
|
+
this._initialized = new Promise<void>(
|
|
65
|
+
async (resolve, reject) => {
|
|
66
|
+
try {
|
|
67
|
+
await this.call(A_StateMachineFeatures.onInitialize);
|
|
68
|
+
|
|
69
|
+
resolve();
|
|
70
|
+
} catch (error) {
|
|
71
|
+
const wrappedError = new A_StateMachineError({
|
|
72
|
+
title: A_StateMachineError.InitializationError,
|
|
73
|
+
description: `An error occurred during state machine initialization.`,
|
|
74
|
+
originalError: error
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
reject(wrappedError);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
);
|
|
65
81
|
}
|
|
66
82
|
|
|
67
83
|
return this._initialized;
|