7 ms·
I had no idea you could compose string literal types AND infer variables using interpolation syntax in the context of conditional types. I am salivating at the
by cjdell 6y ago
I had no idea you could compose string literal types AND infer variables using interpolation syntax in the context of conditional types.
I am salivating at the potential use cases for this...
- ricksharp 6y agoRight! That is insane - I had no idea it was possible to infer part of a string literal. My mind is exploding at the possibilities.
- cuddlecake 6y agoIt's a new feature from TypeScript 4.1 (this version is yet in beta) https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-beta/#template-literal-types https://devblogs.microsoft.com/typescript/announcing-typescr...
- cjdell 6y agoLots of new toys to play with in this release! They've also explained each new feature really well...
- dixon395 6y agoTypescript was created to bring static types in dynamic language, like JS. Now they made the static types more dynamic. What's next?)