正在加载视频...

视频加载失败

Here's two TypeScript tips rolled into one: 1. TypeScript magic is everywhere, even in Node's built-in types 2. I bet you didn't know this was legal TS: error: [message: string]

80,986 次观看 • 1 年前 •via X (Twitter)

10 条评论

Matt Pocock 的头像
Matt Pocock1 年前

My course is 30% off right now!

vaibhav - oss/acc 的头像
vaibhav - oss/acc1 年前

wait this was so easy!!. 2yrs ago i use to copy over this to every project

Corey Ward 的头像
Corey Ward1 年前

I did not know that you could name the items in a tuple type. Gonna go fix some that I have that are less than clear right now!

Matt Pocock 的头像
Matt Pocock1 年前

Great for things like: type Position = [x: number, y: number, z?: number]

Nathan🔶Tarbert 的头像
Nathan🔶Tarbert1 年前

That error type trick is defs something I would've never guessed, Matt's got all the good stuff lol

Artem Zakharchenko 的头像
Artem Zakharchenko1 年前

This has to be new! Nice to see this. Alas, no strongly-typed events for EventTarget in lib.dom. That's why I built Rettime ( That and also a bunch of other reasons.

Twilight 的头像
Twilight1 年前

How strange, I just discovered this yesterday accidentally 😂😂

Raman Paulau 的头像
Raman Paulau1 年前

Vue uses this exact pattern for component defineEmits.

millcake 的头像
millcake1 年前

Bruh... U trying to sell ur course talking about basic things Rly?

DJ Molehill 的头像
DJ Molehill1 年前

TypeScript out here making tuples feel like dark arts. 🧙‍♂️🌀

相关视频