Loading video...

Video Failed to Load

Go Home

🔥 Here's what the new TypeScript 4.9 `Satisfies` Operator is for

75,884 views • 3 years ago •via X (Twitter)

10 Comments

Rachel Leggett's profile picture
Rachel Leggett3 years ago

Oooo interesting, I feel like this is the kind of thing I'll rarely need but it'll be a huge help the one time I need it

hillarious clinton's profile picture
hillarious clinton3 years ago

this is a great example

Evan!'s profile picture
Evan!3 years ago

Seems similar to protocols in Swift where you can specify that a generic type must conform to some protocol using ‘where generic: protocol’

Ryan's profile picture
Ryan3 years ago

This is amazing!

Blessing Adesiji's profile picture
Blessing Adesiji3 years ago

Really nice video! But how do edit this video to show up like this?

A void's profile picture
A void3 years ago

The beauty of wes bos tutorial is he always uses the latest method to check the other latest method. Love your way of teaching

N J O N J O's profile picture
N J O N J O3 years ago

So now we are just going to ignore "as".

Wes Bos's profile picture
Wes Bos3 years ago

as will assert it into a type - you are telling typescript it's a type. satisfies will *ask* typescript if it satisfies the requirement - and typescript will tell you if it trust. as = trust me bro satisfies = could it be?

Nick Rempel's profile picture
Nick Rempel3 years ago

Helpful, thanks!

Wes Bos's profile picture
Wes Bos3 years ago

@_he110w0r1d I don't have any rules on it yet, but I can't see where you could abuse it - its helpful to cut down on type narrowing. We will see as I use it more

Related Videos