Check if class instance is instance of provided type
I have a function that dynamically loads a folder with ts files, initiates the classes in them and saves them. The function takes in a type for its return type like this
load<T extends BaseInteraction>
load<T extends BaseInteraction>
. But when i use
DynamicClass instanceof T
DynamicClass instanceof T
it says
'T' only refers to a type, but is being used as a value here.
'T' only refers to a type, but is being used as a value here.
. is there a way to compare the class to the provided class?