refactor: remove SCMetaTranslations singletons

This commit is contained in:
Rainer Killinger
2022-05-31 12:52:50 +02:00
parent 9d0ff36af5
commit c43e2b38e6
38 changed files with 229 additions and 290 deletions

View File

@@ -269,11 +269,6 @@ export interface SCThingTranslatablePropertyOrigin {
* Meta information about things
*/
export class SCThingMeta implements SCMetaTranslations<SCThing> {
/**
* Set type definition for singleton instance
*/
protected static _instance = new Map<string, unknown>();
/**
* Translations of fields
*/
@@ -315,19 +310,4 @@ export class SCThingMeta implements SCMetaTranslations<SCThing> {
type: 'Thing',
},
};
// tslint:disable:static-this
/**
* Function to retrieve typed singleton instance
*/
public static getInstance<T extends SCThingMeta>(): T {
if (!SCThingMeta._instance.has(this.name)) {
SCThingMeta._instance.set(this.name, new this());
}
return SCThingMeta._instance.get(this.name) as T;
}
protected constructor() {
}
}