Home · Simon Holywell on Simon Holywell · May 27, 2019
TypeScript constructors and generic types
0Sign in to vote or save
This site does not allow itself to be embedded. You can still read it on the original site — the toolbar below keeps your place in the directory.
I have recently found myself needing a type for class constructors that is at once generic and tight enough to ensure a genuine constructor. This is useful in situations where you must handle a variety of classes - those that come from other libraries or applications that you cannot control. When writing your own dependency injection container or some other generalised library you cannot know what…
Comments
Nothing yet. Say the first thing.
Sign in to join the conversation.