-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
SuggestionAn idea for TypeScriptAn idea for TypeScriptToo ComplexAn issue which adding support for may be too complex for the value it addsAn issue which adding support for may be too complex for the value it adds
Description
I think it´s a good idea to let an internal class declaration:
class A{
class B{}
}
Emit proposal:
var A = (function () {
var B = (function () {
function B() {
}
return B;
})();
function A() {
}
return A;
})();
We can use it to make Singleton very easy.
class Singleton{
class B{
private enforcer:string;
}
private static _instance:Singleton;
constructor(enforcer: B){}
public static get instance():Singleton{
if (Singleton._instance === undefined){
Singleton._instance = new Singleton(new B())
}
return Singleton._instance;
}
}
Related: #3266
Metadata
Metadata
Assignees
Labels
SuggestionAn idea for TypeScriptAn idea for TypeScriptToo ComplexAn issue which adding support for may be too complex for the value it addsAn issue which adding support for may be too complex for the value it adds