typescript-tips

stackblitz StackBlitz (@stackblitz) - November 16, 2020 at 11:03 PM

💡 TypeScript tip (6):

If your function/class will work with multiple types but they need to meet some minimal criteria, you can specify the minimal shape a generic must have by extending it:

<T extends MyBaseType> pic.twitter.com/F74tddnmdU

Tweet link