3 ms·
This is just string typing: PlaneFactory.getInstance<Plane>('BoeingPlane') Doesn't that defeat the point of both TypeScript and the factory pattern?
by boffinism 4y ago
This is just string typing:
PlaneFactory.getInstance<Plane>('BoeingPlane')
Doesn't that defeat the point of both TypeScript and the factory pattern?
- boffinism 4y agoAlso, if I'm calling 'getInstance' on PlaneFactory, why am I having to explicitly assert that I'm expecting a Plane in return? Isn't that a given?