In Typescript, is it possible to specify a generic type as generic? Specifically, I would like to be able to define a function signature as follows:
function events<T>(): T<Event>
However I am receiving the following error from the typescript compiler:
[ts] Type 'T' is not generic.
"generic type as a generic": if I understand correctly what you are trying to achieve is to use higher kinded types.
This not (yet) possible in Typescript: see this
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With