|
|
|
|
|
by tdbgamer
2951 days ago
|
|
I really liked Elm a lot, but the issue for me was that composing components is a shit show. You have to add variants to the root Msg type for every single subpage and have it dispatch to the right update/view functions. I'm really excited about a project inspired by Elm called Yew but allows you compose components much more naturally and easily. https://github.com/DenisKolodin/yew |
|
Doesn’t that make sense, though?
An app in Elm is some kind of state + messages that change the state. Since the state is usually too big to fit in a single structure, you break it down recursively into progressively smaller substates. These again have some messages that mutate the state.
Now, doesn’t it make sense to send the “child” messages through the parents? You shouldn’t command the children directly, you should always tell the parent to tell the child do this and that. At least in our [Swift, not Elm] app that makes sense, composes well and keeps the model simple to think about.