elm-hedley
elm-hedley copied to clipboard
Use elm-response to remove code duplication in App.Update
Looking at the example in the package:
SubAction subAction ->
-- let (newSub, newSubEffects) = subActionUpdate subAction model.sub
-- in (\sub -> { model | sub = newSub }) (Effects.map SubAction newSubEffects)
subActionUpdate subAction model.sub
|> mapBoth (\sub -> { model | sub = sub }) SubAction
this could save some code duplication in App.Update and in general be a nice addition :)
(cc @etaque)
Oh, actually it seems that we always pass a different context
to sub components or re-build the effects
Maybe we could use it on simpler sub-components. If not, then we'll sure use it in other projects ;)
:+1: