Closed gergoerdi closed 1 year ago
Nice find! Feel free to open a PR with a new module Web.MVC.Widget
for adding this. I'm sure there are other patterns still hidden from us. In another issue, comonads were mentioned as an abstract for user interfaces. Might well be that what you wrote above is related.
Design question: should we have display : Maybe Ev -> St -> Cmd Ev
, or setup : Cmd Ev, display : Ev -> St -> Cmd Ev
? The difference is that with the latter we can change the Semigroup
operator so that events firing from widgets don't cause updates on the other widgets.
Design question: should we have
display : Maybe Ev -> St -> Cmd Ev
, orsetup : Cmd Ev, display : Ev -> St -> Cmd Ev
? The difference is that with the latter we can change theSemigroup
operator so that events firing from widgets don't cause updates on the other widgets.
I'd prefer the latter here. So we start with an initial state and an initial Cmd Ev
instead of an initializing event. That sounds like a good choice.
I'm finding in practice that setup : St -> Cmd Ev
is such a huge ergonomic win over setup : Cmd Ev
that it should be worth it even if it's technically / theoretically redundant.
Closed via #34
Just a draft of an idea for orthogonal UI elements: