@prestizni-software/client-dem 0.2.9 → 0.2.11
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.
|
@@ -21,6 +21,7 @@ export async function AUCManagerFactory<
|
|
|
21
21
|
emitter
|
|
22
22
|
);
|
|
23
23
|
classers[key] = c;
|
|
24
|
+
await c.isLoadedAsync();
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
return classers;
|
|
@@ -42,6 +43,7 @@ export class AutoUpdateClientManager<
|
|
|
42
43
|
this.classes[id] = await this.handleGetMissingObject(id);
|
|
43
44
|
this.classesAsArray.push(this.classes[id]);
|
|
44
45
|
}
|
|
46
|
+
emitter.dispatchEvent(new Event("ManagerLoaded"+this.classParam.name+this.className));
|
|
45
47
|
});
|
|
46
48
|
socket.on("new" + classParam.name, async (id: string) => {
|
|
47
49
|
this.classes[id] = await this.handleGetMissingObject(id);
|
|
@@ -16,6 +16,7 @@ export abstract class AutoUpdateManager<T extends Constructor<any>> {
|
|
|
16
16
|
};
|
|
17
17
|
protected classesAsArray: AutoUpdated<T>[] = [];
|
|
18
18
|
protected emitter: EventTarget;
|
|
19
|
+
private isLoaded = false;
|
|
19
20
|
constructor(
|
|
20
21
|
classParam: T,
|
|
21
22
|
socket: SocketType,
|
|
@@ -42,6 +43,13 @@ export abstract class AutoUpdateManager<T extends Constructor<any>> {
|
|
|
42
43
|
return this.classes[_id];
|
|
43
44
|
}
|
|
44
45
|
|
|
46
|
+
public async isLoadedAsync(): Promise<boolean> {
|
|
47
|
+
if (this.isLoaded) return this.isLoaded;
|
|
48
|
+
await new Promise((resolve) => this.emitter.addEventListener("ManagerLoaded"+this.classParam.name+this.className, resolve));
|
|
49
|
+
this.isLoaded = true;
|
|
50
|
+
return this.isLoaded;
|
|
51
|
+
}
|
|
52
|
+
|
|
45
53
|
public async deleteObject(_id: string): Promise<void> {
|
|
46
54
|
if (typeof this.classes[_id] === "string")
|
|
47
55
|
this.classes[_id] = await this.handleGetMissingObject(this.classes[_id]);
|
|
@@ -77,7 +77,7 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
|
|
|
77
77
|
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
|
-
this.emitter.addEventListener("loaded", async () => {
|
|
80
|
+
this.emitter.addEventListener("loaded"+this.EmitterID, async () => {
|
|
81
81
|
try {
|
|
82
82
|
await this.loadForceReferences();
|
|
83
83
|
} catch (error) {
|
|
@@ -174,7 +174,7 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
|
|
|
174
174
|
await this.loadShit();
|
|
175
175
|
return this.isLoading
|
|
176
176
|
? new Promise((resolve) => {
|
|
177
|
-
this.emitter.addEventListener("loaded", () => {
|
|
177
|
+
this.emitter.addEventListener("loaded"+this.EmitterID, () => {
|
|
178
178
|
resolve(this.isLoading === false);
|
|
179
179
|
});
|
|
180
180
|
})
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.2.11](https://github.com/Prestizni-Software/client-dem/compare/v0.2.10...v0.2.11) (2025-11-06)
|
|
6
|
+
|
|
7
|
+
### [0.2.10](https://github.com/Prestizni-Software/client-dem/compare/v0.2.9...v0.2.10) (2025-11-06)
|
|
8
|
+
|
|
5
9
|
### [0.2.9](https://github.com/Prestizni-Software/client-dem/compare/v0.2.8...v0.2.9) (2025-11-06)
|
|
6
10
|
|
|
7
11
|
### [0.2.8](https://github.com/Prestizni-Software/client-dem/compare/v0.2.7...v0.2.8) (2025-11-06)
|