Thinking about this a little more...should the Sub module just have 
something like the following?

combineSubscriptions : List (m -> Sub msg) -> (m -> Sub msg)
combineSubscriptions list model =
    Sub.batch (List.map ((|>) model) list)

Thanks again!

Marshall

On Tuesday, December 20, 2016 at 1:39:43 PM UTC-5, Marshall handheld Flax 
wrote:
>
> My main program has two types of subscriptions: UI subscriptions (e.g. on 
> Keyboard.downs) defined in my View.elm, and Websocket.Listen subscriptions 
> defined in my State.elm.  But to batch them together, I need to create an 
> anonymous function to factor the model through.  Is this idiomatic or is 
> there a better way? 
>
> Thank you!!!
>
> Marshall
>
> main =
>     Html.program
>         { init = State.init
>         , update = State.update
>         , view = View.root
>         , subscriptions = \model -> Sub.batch [ View.viewSubscriptions 
> model, State.webSubscriptions model ]
>         }
>
>
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to