Hey Fam 👋
I struggled with using typescript and ramda for a long time and figured I would brain dump a little. Maybe it will help some one else! Specifically, I struggled with how typescript can't always infer generics that ramda defines. The result is writing verbose types that are not really necessary, or forcing types with as
and !
.
Generics are super weird when getting into them, that coupled with ramda being a monster and typescript not being able to readily infer everything is a perfect shitstorm.
Whenever I work with ramda, my workflow is:
- Do a thing and assign it to a variable.
- If the variable isn't the type I expect, jump to the definition of the function in ramda