2022-11-27 23:23:47 +08:00
|
|
|
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() {
|
|
|
|
}
|
2022-12-01 22:26:41 +08:00
|
|
|
}
|