(Cover image: Lanterns, by Anna Sánchez Inglada. Original picture here)
Lately I've been learning Elm and I'm entirely fascinated by its union typ...
For further actions, you may consider blocking this person and/or reporting abuse
thank u for this! needed a refresher on union types w/ react & this was exactly what I was looking for! really appreciated the custom
union
helper function too. it was also super helpful in getting the juices flowing so that I could come to a solution for the task at hand.declarative UIs FTW! thanks again :)
Wonderful! I'm glad you found it useful!
I'm adding this post on my always favorite list!
I had seen other implementations of algebric data types in Javascript and none was so simple and elegant.
Thank you for the incredible article and high fives for the solution!
Thanks for your keen words, I appreciate it!
When I learned about algebraic data types I checked out a couple of Javascript libraries, but it seemed a bit overkill to use them, so I came up with this implementation.
Hi! Nice article and great job with the examples. In the react example I think the code turned out to be slightly more readable with the union types than it would be with a bunch of ifs.
Anyway, it s a good tool to have in a coder s toolbox. Thanks!
Thanks for your comments!
This is a really great article! If you haven't used Daggy JS before, I would highly recommend.
Thank you! I had looked at Daggy, but I haven't used it in a real project yet.
+1 just for citing the author of the photograph. Almost nobody does that.