|
|
|
|
|
by hajile
2487 days ago
|
|
ReasonML variants are type constructors. Your example completely eliminated all action creators (constructors). Once you add those functions back, most of the type bloat reappears. I wouldn't want to work on a project where everyone was creating object literals and passing them to dispatch everywhere. |
|
If you insist on having the action creators, they can easily be written as one liners each, which is a lot less bloated than the original example.
What's the issue with passing object literals? I know it looks a bit hacky and messy, but if it's typesafe (which it is) then it doesn't seem like a real issue.