I don’t know much about elm architecture internally but can we just have one general msg/update like:
type Msg m = Upd (m -> m)
update msg model =
case msg of
Upd f -> f model
and then used in all views without having to specify actions in two other places like:
view model =
div []
[ button [ onClick (Upd (\m->m-1)) ] [ text "-" ]
, div [] [ text (toString model) ]
, button [ onClick (Upd (\m->m+1)) ] [ text "+" ]
]
i found it works even in more complex cases so I’m wondering if I’m missing anything.thanks