Загрузка видео...

Не удалось загрузить видео

На главную

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

75,884 просмотров • 3 лет назад •via X (Twitter)

Комментарии: 10

Фото профиля Rachel Leggett
Rachel Leggett3 лет назад

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
hillarious clinton3 лет назад

this is a great example

Фото профиля Evan!
Evan!3 лет назад

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

Фото профиля Ryan
Ryan3 лет назад

This is amazing!

Фото профиля Blessing Adesiji
Blessing Adesiji3 лет назад

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

Фото профиля A void
A void3 лет назад

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
N J O N J O3 лет назад

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

Фото профиля Wes Bos
Wes Bos3 лет назад

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
Nick Rempel3 лет назад

Helpful, thanks!

Фото профиля Wes Bos
Wes Bos3 лет назад

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

Похожие видео