I prefer the former style. It's less verbose, and it means my Main module
is the only one that needs to import Html.App. Also, with the latter style,
your helper is going to have something like "Html.Events.onCheck identity",
which seems a little silly.

That's just my preference though. I think either one seems fine, as long as
you're consistent :-)

On Wed, Sep 21, 2016 at 10:19 AM, Mark Hamburg <mhamburg...@gmail.com>
wrote:

> When writing a view function (or helper function that generates part of
> the view hierarchy), is it better to take a function mapping values or
> messages to parent messages or to use Html.App.map for this? In other
> words, is it better to write:
>
> viewCheckbox SetMyCheckboxState "My Checkbox" model.myCheckboxState
>
> viewCheckbox : (Bool -> msg) -> String -> Bool -> Html msg
>
>
> or to write:
>
> Html.App.map SetMyCheckboxState
>     <| viewCheckbox "My Checkbox" model.myCheckboxState
>
> viewCheckbox : String -> Bool -> Html Bool
>
>
> Mark
>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elm-discuss+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to