You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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;
}
}
Activity
kitsonk commentedon Aug 26, 2015
How would you propose emitting this when targeting ES6, since that isn't valid ES6?
RyanCavanaugh commentedon Aug 26, 2015
This doesn't add enough value over already-supported local types: