3 ms·
> You shouldn't need type manipulation because you shouldn't be leaning heavily on variable mutation What does type manipulation have to do with variable mutat
by jcparkyn 4y ago
> You shouldn't need type manipulation because you shouldn't be leaning heavily on variable mutation
What does type manipulation have to do with variable mutation? The main examples in the OP were of redux and related libraries, which use huge amounts of type manipulation but almost no mutation. I'm honestly not sure where the link between these two things would be, because to me they seem completely orthogonal.
- lucideer 4y ago"type manipulation" is a broad section in the TS handbook - it even includes very core things like generics. So I admit I did jump the gun on focusing on parts of it that may be more exceptional/messy in their application (& lead to difficult-to-work-with types); like conditional types or assertions. After diving into the OPs linked examples, it appears that all they mean when they say "type manipulation" is just... generics. Generics can be as simple or as convoluted as you write them. The linked examples certainly does look over-engineered: if you've got identifiers like `ActionCreatorForCaseReducerWithPrepare` in your library, you're entering into Java managermanager meme level of silliness there. That's not something you can blame Typescript for.