'Typescript let a Function return Generic Type
Heyho is it possible that a generic class have a function that returns its generic type?
export class RmqtAction<T, K> {
action: string;
payload = () => T;
returnType = () => K;
}
something like this as i want to create Typesafe actions between my microservices. (i only need typesafety in compiletime not runtime)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
