@prestizni-software/client-dem 0.2.19 → 0.2.20
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/AutoUpdatedClientObjectClass.ts +2 -6
- package/CHANGELOG.md +2 -0
- package/package.json +1 -1
|
@@ -21,7 +21,7 @@ export type AutoUpdated<T extends Constructor<any>> =
|
|
|
21
21
|
export async function createAutoUpdatedClass<C extends Constructor<any>>(
|
|
22
22
|
classParam: C,
|
|
23
23
|
socket: SocketType,
|
|
24
|
-
data: IsData<InstanceType<C
|
|
24
|
+
data: RefToId<IsData<InstanceType<C>>> | string,
|
|
25
25
|
loggers: LoggersType,
|
|
26
26
|
autoClassers: { [key: string]: AutoUpdateManager<any> },
|
|
27
27
|
emitter: EventTarget
|
|
@@ -29,8 +29,6 @@ export async function createAutoUpdatedClass<C extends Constructor<any>>(
|
|
|
29
29
|
if (typeof data !== "string")
|
|
30
30
|
processIsRefProperties(data, classParam.prototype, undefined, [], loggers);
|
|
31
31
|
const props = Reflect.getMetadata("props", classParam.prototype);
|
|
32
|
-
if (typeof data !== "string")
|
|
33
|
-
checkForMissingRefs<C>(data, props, classParam, autoClassers);
|
|
34
32
|
const instance = new (class extends AutoUpdatedClientObject<C> {})(
|
|
35
33
|
socket,
|
|
36
34
|
data,
|
|
@@ -140,6 +138,7 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
|
|
|
140
138
|
this.unpopulatedData = { _id: data } as any;
|
|
141
139
|
} else {
|
|
142
140
|
this.isLoading = true;
|
|
141
|
+
this.unpopulatedData = data;
|
|
143
142
|
checkForMissingRefs<T>(
|
|
144
143
|
data as any,
|
|
145
144
|
properties,
|
|
@@ -148,7 +147,6 @@ export abstract class AutoUpdatedClientObject<T extends Constructor<any>> {
|
|
|
148
147
|
);
|
|
149
148
|
this.data = data as any;
|
|
150
149
|
|
|
151
|
-
this.unpopulatedData = data;
|
|
152
150
|
if (this.data._id === "") this.handleNewObject(data as any);
|
|
153
151
|
else this.isLoading = false;
|
|
154
152
|
}
|
|
@@ -441,10 +439,8 @@ export function processIsRefProperties(
|
|
|
441
439
|
const path = prefix ? `${prefix}.${prop}` : prop;
|
|
442
440
|
allProps.push(path);
|
|
443
441
|
if (Reflect.getMetadata("isRef", target, prop)) {
|
|
444
|
-
// 👇 here’s where you mutate
|
|
445
442
|
(loggers ?? console).debug("Changing isRef:", path);
|
|
446
443
|
|
|
447
|
-
// Example: replace with a proxy or a marker object
|
|
448
444
|
instance[prop] =
|
|
449
445
|
typeof instance[prop] === "string"
|
|
450
446
|
? instance[prop]
|
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.20](https://github.com/Prestizni-Software/client-dem/compare/v0.2.19...v0.2.20) (2025-11-10)
|
|
6
|
+
|
|
5
7
|
### [0.2.19](https://github.com/Prestizni-Software/client-dem/compare/v0.2.18...v0.2.19) (2025-11-10)
|
|
6
8
|
|
|
7
9
|
### [0.2.18](https://github.com/Prestizni-Software/client-dem/compare/v0.2.17...v0.2.18) (2025-11-10)
|