正在加载视频...

视频加载失败

In TypeScript, interfaces and types are often interchangeable. But these are 6 features that only work with a type alias. Clip from "TypeScript: Getting Started" on Dometrain

56,144 次观看 • 1 年前 •via X (Twitter)

10 条评论

Cory House 的头像
Cory House1 年前

Full course with a 20% discount:

Tymek Zapała 的头像
Tymek Zapała1 年前

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.

Ryu 的头像
Ryu1 年前

Seriously most of what I know about typescript I learned from you and @mattpocockuk

Cory House 的头像
Cory House1 年前

@mattpocockuk Thanks! And yep Matt is a fantastic teacher

tom byrer 的头像
tom byrer1 年前

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.

Cory House 的头像
Cory House1 年前

@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

ℤ 的头像
1 年前

1:19 seconds of 🔥🔥🔥

Cory House 的头像
Cory House1 年前

Thanks!

Friedrich 的头像
Friedrich1 年前

That's why I only use types. There is also interfaces merging that can be misleading

Juan Roa 的头像
Juan Roa1 年前

Great tips for such commons workarounds while working with TS!

相关视频