aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/SerializationHelper.ts
diff options
context:
space:
mode:
authorMohammad Amoush <mohammad_amoush@brown.edu>2019-07-29 19:45:25 -0400
committerMohammad Amoush <mohammad_amoush@brown.edu>2019-07-29 19:45:25 -0400
commit41583609724911182f2c16b06e61bee6a779bb34 (patch)
treeff32273d40d832edd24385b4ea7a7b95ef311f21 /src/client/util/SerializationHelper.ts
parent215b73fbcfe0d6f205668e1bb7c755228e858ac9 (diff)
parentd7af2cae3ec66ca9a8c9abbc0a221ee1dbb6d101 (diff)
Merge master, quick opacity changes
Diffstat (limited to 'src/client/util/SerializationHelper.ts')
-rw-r--r--src/client/util/SerializationHelper.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/util/SerializationHelper.ts b/src/client/util/SerializationHelper.ts
index 94b640afa..034be8f67 100644
--- a/src/client/util/SerializationHelper.ts
+++ b/src/client/util/SerializationHelper.ts
@@ -91,15 +91,15 @@ export function Deserializable(constructor: { new(...args: any[]): any } | strin
if (typeof constructor === "string") {
return Object.assign((ctor: { new(...args: any[]): any }) => {
addToMap(constructor, ctor);
- }, { withFields: Deserializable.withFields });
+ }, { withFields: (fields: string[]) => Deserializable.withFields(fields, name, afterDeserialize) });
}
addToMap(constructor.name, constructor);
}
export namespace Deserializable {
- export function withFields(fields: string[]) {
+ export function withFields(fields: string[], name?: string, afterDeserialize?: (obj: any) => void | Promise<any>) {
return function (constructor: { new(...fields: any[]): any }) {
- Deserializable(constructor);
+ Deserializable(name || constructor.name, afterDeserialize)(constructor);
let schema = getDefaultModelSchema(constructor);
if (schema) {
schema.factory = context => {