stackblitz - 1328353096179789824
Last updated
Last updated
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
https://user-images.githubusercontent.com/870029/208133765-cdc499ec-1783-49bc-8bd3-82d4bb37f8ef.mp4