export function Singleton<E>() {
class SingletonE {
protected constructor() {}
private static _ins: SingletonE = null;
public static get Ins(): E {
if (SingletonE._ins == null) SingletonE._ins = new this();
return SingletonE._ins as E;
}
}
return SingletonE;
}
|