by smt88 · 8y ago · 0 comments
Generics are a complex concept for people to grasp without some time playing and reading docs, but once you learn it, you can express almost everything you want.
But for simple projects you can get away with all but the most basic of generics, if any at all.
With the release of conditional types, I find most of my js typing cases are covered.
Though tbh I've always leant toward the side of "if you can't express it easily, then you're being to JavaScripty".
Another issue is that handling of string literals as types can be wonky when they're being compared against the type "string", which they should always satisfy but sometimes don't.