@prestizni-software/client-dem 0.2.10 → 0.2.12
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]);
|
|
@@ -355,7 +355,7 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
|
|
|
355
355
|
|
|
356
356
|
private async loadForceReferences(
|
|
357
357
|
obj: any = this.data,
|
|
358
|
-
proto: any = Object.getPrototypeOf(this)
|
|
358
|
+
proto: any = Object.getPrototypeOf(this.classProp)
|
|
359
359
|
) {
|
|
360
360
|
const props: string[] = Reflect.getMetadata("props", proto) || [];
|
|
361
361
|
|
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.12](https://github.com/Prestizni-Software/client-dem/compare/v0.2.11...v0.2.12) (2025-11-06)
|
|
6
|
+
|
|
7
|
+
### [0.2.11](https://github.com/Prestizni-Software/client-dem/compare/v0.2.10...v0.2.11) (2025-11-06)
|
|
8
|
+
|
|
5
9
|
### [0.2.10](https://github.com/Prestizni-Software/client-dem/compare/v0.2.9...v0.2.10) (2025-11-06)
|
|
6
10
|
|
|
7
11
|
### [0.2.9](https://github.com/Prestizni-Software/client-dem/compare/v0.2.8...v0.2.9) (2025-11-06)
|