正在加载视频...

视频加载失败

Every time I post this, I get so many WTF's in the comments. It's the 'string & {}' trick. Still absolutely essential for getting 'loose autocomplete' in library code.

77,748 次观看 • 1 年前 •via X (Twitter)

11 条评论

Matt Pocock 的头像
Matt Pocock1 年前

My course is the bomb, if bombs were 30% off

SecBriefs | Making Cybersecurity Simple 的头像
SecBriefs | Making Cybersecurity Simple2 年前

🧠Studying for #CompTIA #Security+ but struggling with #Cybersecurity terms?🔍 Cybersecurity Dictionary for Everyone covers everything you need to know and is available on Amazon!🔐 🚀Boost your Security+ prep with it today!💡

Panta 的头像
Panta1 年前

Super cool! I was curious so I gave it a try - it seems to also work with a String constructor!

Renato Carneiro 的头像
Renato Carneiro1 年前

type DontFuckMyAutoComplete<T extends string> = T | (string & {}); type Model = DontFuckMyAutoComplete <“gpt-4o” | “gemini”>;

Michael Feldstein 的头像
Michael Feldstein1 年前

great explanation of why this works

Cory Simmons 的头像
Cory Simmons1 年前

I'm not going to learn anything else about Typescript. I'm just going to have AI do it and hope it works. Tired of all this goofy stuff

Tom Duncalf 的头像
Tom Duncalf1 年前

Haha that's wild. Had no idea this was possible. Nice explanation :)

Akaam Shamerany 的头像
Akaam Shamerany1 年前

TIL

Ryan Rampersad 的头像
Ryan Rampersad1 年前

For a second there, I thought that was a Rust syntax trick you were sharing

Light 的头像
Light1 年前

Ok nice

shaqcn 的头像
shaqcn1 年前

WTF

相关视频