Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use elm-response to remove code duplication in App.Update #137

Open
amitaibu opened this issue Mar 30, 2016 · 2 comments
Open

Use elm-response to remove code duplication in App.Update #137

amitaibu opened this issue Mar 30, 2016 · 2 comments

Comments

@amitaibu
Copy link
Member

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)

@amitaibu
Copy link
Member Author

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 ;)

@etaque
Copy link

etaque commented Mar 30, 2016

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants