2022-12-08 21:14:02 +08:00

13 lines
244 B
TypeScript

export default class Singleton {
private static _instance: any = null;
static GetInstance<T>(): T {
if (this._instance === null) {
this._instance = new this();
}
return this._instance;
}
protected constructor() {}
}