node
typescript
alpha

Create a derived class from a static method of an abstract class

Author: Jakub Sydor

The problem

You are faced with the problem of creating an abstract class, which, by means of static methods, is to create the given derived classes. In this article we will show you a solution to this problem created in TypeScript. In our project we had to implement several games, we did not want to create separate endpoints for each game, but to keep a consistent interface for each of them. We managed to do this with the solution just presented below.