Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

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

75,884 Aufrufe • vor 3 Jahren •via X (Twitter)

10 Kommentare

Profilbild von Rachel Leggett
Rachel Leggettvor 3 Jahren

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

Profilbild von hillarious clinton
hillarious clintonvor 3 Jahren

this is a great example

Profilbild von Evan!
Evan!vor 3 Jahren

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

Profilbild von Ryan
Ryanvor 3 Jahren

This is amazing!

Profilbild von Blessing Adesiji
Blessing Adesijivor 3 Jahren

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

Profilbild von A void
A voidvor 3 Jahren

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

Profilbild von N J O N J O
N J O N J Ovor 3 Jahren

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

Profilbild von Wes Bos
Wes Bosvor 3 Jahren

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?

Profilbild von Nick Rempel
Nick Rempelvor 3 Jahren

Helpful, thanks!

Profilbild von Wes Bos
Wes Bosvor 3 Jahren

@_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

Ähnliche Videos