In TypeScript, interfaces and types are often interchangeable.
@housecor16万 位关注者
56,144 次观看
10 条评论
评论来自 X (Twitter) 上的原帖

@housecor
Full course with a 20% discount:
6 个赞

@tymzap
Types are great. I do not see any reason to use interfaces - they have less use cases and brings risk of accidental declaration merging to codebase.
4 个赞

@rmiyazaki3
Seriously most of what I know about typescript I learned from you and @mattpocockuk
3 个赞

@housecor
@mattpocockuk Thanks! And yep Matt is a fantastic teacher
2 个赞

@tombyrer
The thing I hate about TS is that is lots of programming time that is not programming that significantly moves the needle forward. I hope @typescript team will add auto-typing in Phase 3 of their GoLang transition, or some AI wiz makes a small locally hostable model to do this.
2 个赞

@housecor
@typescript I find adding types takes little time and tends to “flow” through the code once I’ve delivered the type once. Often mainly need types for the json fetched from APIs
3 个赞

@technically_zac
1:19 seconds of 🔥🔥🔥
1 个赞

@housecor
Thanks!
1 个赞

@FriedrichC109
That's why I only use types. There is also interfaces merging that can be misleading
1 个赞

@jroadev
Great tips for such commons workarounds while working with TS!
1 个赞
