Home > Mobile >  Forward type parameters to generic type when implementing generic function
Forward type parameters to generic type when implementing generic function

Time:04-03

Say I'm given a function type like so. I can already implement a function of that type, and not need to declare the argument or return types again:

type MyFunc = (args: string) => boolean;

// TS knows args is a string and return is boolean            
  • Related