Skip to content
Advertisement

Tag: mixins

TypeScript Mixins and Constructor Names

I have this sample of code experimenting with mixins in TypeScript. However, it is not returning what I am expecting. It should give me: User ({“id”:3,”name”:”Lorenzo Delaurentis”}). Instead, I am getting: Function ({“id”:3,”name”:”Lorenzo Delaurentis”}). The line let Name = Class.constructor.name should give me User, but it is not. Am I missing something obvious here? P.S. I compiled with tsc mixins

Advertisement