TypeScript Plugged In: Function Type Parameters & Generic Constraints

preview_player
Показать описание

Sooner or later everyone will have to create, or at least use a utility function, which uses type parameters underneath. And sooner or later there might be an unexpected error being thrown because of invalid resolution of the type parameters. Let's dive into the semantics of type parameters and generic constraints.

00:00 intro
00:24 create a utility function
00:55 string key throw a compiler error
01:23 without the key type parameter
01:44 invalid result type
02:55 missing type parameter
03:52 type parameter with a generic constraint
Рекомендации по теме
join shbcf.ru