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'm aware that I get a new constructor function each time and there's no prototype sharing, but I don't care. I see a high potential in this pattern for true information hiding. It is even better for inheritance. A base class could evolve without breaking derived classes.
To make it fit on TypeScript, however, automatic generation of declarations or somehow compiler being able to interpret this pattern is needed I think. An identifier for this factory type is needed.
One should be able to do the following then, based on the second snippet:
functionMyController(myService: myFactory2){}
The text was updated successfully, but these errors were encountered:
TLDR: How to generated .d.ts from function-scoped class expressions?
Consider the following snippet:
As you can see, I have to make a field for a dependency. This is so C# (I like C#) but I'd prefer the JavaScript way in JavaScript.
Then I make a closure:
I'm aware that I get a new constructor function each time and there's no prototype sharing, but I don't care. I see a high potential in this pattern for true information hiding. It is even better for inheritance. A base class could evolve without breaking derived classes.
To make it fit on TypeScript, however, automatic generation of declarations or somehow compiler being able to interpret this pattern is needed I think. An identifier for this factory type is needed.
One should be able to do the following then, based on the second snippet:
The text was updated successfully, but these errors were encountered: