[elm-discuss] Re: view function to call other view function with different Msg type

2017-04-25 Thread David Legard
> > Well, the problem is itemView can't be used , as it is 'Html ItemMsg', and > not 'Html Msg' > However, the Item module doesn't have access to 'Msg' ( which is top level > ), > Whenever I run into that problem, I create a separate file *MessageTypes.elm* with the Msg types in it and

Re: [elm-discuss] Re: view function to call other view function with different Msg type

2017-04-25 Thread Witold Szczerba
Maybe it will help you to know that I always return top level messages from my views. Like this: input [ type_ "checkbox" , checked form.queryAssignedOnly , onCheck (Msg.PayoutList << PayoutMsg.UpdateQueryAssignedOnly) ] Just for the record, the (Msg.PayoutList <<

[elm-discuss] Re: view function to call other view function with different Msg type

2017-04-25 Thread Vardhan
Hi, On Monday, April 24, 2017 at 10:54:28 PM UTC+5:30, Erik Lott wrote: > > Whoops. Html.map is correct... > Thanks for the answers. However I later ``discovered`` that the top Msg will have to include a id too , type Msg= ItemMsg IDType ItemMsg .. so things got more complicated.

[elm-discuss] Re: view function to call other view function with different Msg type

2017-04-24 Thread Erik Lott
Whoops. Html.map is correct... view : Model -> Html Msg view model = div [] (model.items |> List.map itemView |> List.map (Html.map ItemMsg) ) On Sunday, April 23, 2017 at 1:49:22 PM UTC-4, Max Goldstein wrote: > > Yes, Ian is correct. > >

[elm-discuss] Re: view function to call other view function with different Msg type

2017-04-23 Thread Max Goldstein
Yes, Ian is correct. Html.Attributes.map : (a -> msg) -> Attribute a -> Attribute msg Html.map : (a -> msg) -> Html a -> Html msg -- You

[elm-discuss] Re: view function to call other view function with different Msg type

2017-04-23 Thread Ian Mackenzie
Shouldn't that be Html.map, not Html.Attributes.map? itemView returns a Html msg, not an Html.Attribute msg... On Saturday, 22 April 2017 21:53:47 UTC-4, Erik Lott wrote: > > view : Model -> Html Msg > view model = > div [] > (model.items > |> List.map itemView >

[elm-discuss] Re: view function to call other view function with different Msg type

2017-04-22 Thread Erik Lott
view : Model -> Html Msg view model = div [] (model.items |> List.map itemView |> List.map (Html.Attributes.map ItemMsg) ) On Saturday, April 22, 2017 at 5:25:41 PM UTC-4, Vardhan wrote: > > [ Pardon if this appear twice ] > > hi, > this is my