TypeScript Got a New Utility Type

preview_player
Показать описание
I like what the TypeScript team is doing. These updates are to the point, nicely communicated with their blog, and serve a purpose.

-- my links
Рекомендации по теме
Комментарии
Автор

That little bit of excalidraw really helped to make the point clear.

SoreBrain
Автор

function configureDevice<OS extends string, OSDefault extends OS>(
allowOs: OS[],
defaultOs?: OSDefault
) {
//...
}
this works also
great video Josh!

juanferrer
Автор

Hello Matt Pocock if he was 30 years younger with hair 👋

hyperprotagonist
Автор

fuck I really needed this. was pulling my hairs out a month ago because it was just not narrowing down the type

marusdod
Автор

Josh you're not planning on celebrating 100k youtube followers? People kill to get there 🎉😊

riveto_ir
Автор

Great video! Very simple examples that showcase the original problem and how these features take care of them.

FurryDanOriginal
Автор

Great video first of all, out of curiosity, would like to know what tool is used for sketching?

ahammadalipk
Автор

Thank your for this video. But the second example is soooo complicated. A simple enum type would solve everything. Guys remember, you use Ts to simplify the reading of your code and avoid bugs ? Or to write ambiguous code ?

seroltech
Автор

For those wondering how to get around the bug with NoInfer in the latest version, here is an alternative that does basically the same thing.
type NoInfer<T>=[T][T extends any? 0:never]

akam
Автор

Return a Rounded number, okay well return a number string with 2 decimal points

Uh....

thekwoka
Автор

TS is getting more and more complicated. is Dart this complicated? I don't think so.

greendsnow