Back to Browse

TypeScript Plugged In: Function Type Parameters & Generic Constraints

112 views
Premiered May 21, 2024
4:53

https://ducin.dev, #typescript playground: https://tsplay.dev/m3qkqw 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

Download

0 formats

No download links available.

TypeScript Plugged In: Function Type Parameters & Generic Constraints | NatokHD