@prestizni-software/client-dem 0.2.10 → 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]);
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
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
|
+
|
|
5
7
|
### [0.2.10](https://github.com/Prestizni-Software/client-dem/compare/v0.2.9...v0.2.10) (2025-11-06)
|
|
6
8
|
|
|
7
9
|
### [0.2.9](https://github.com/Prestizni-Software/client-dem/compare/v0.2.8...v0.2.9) (2025-11-06)
|