- run
npm install
- run
node server.js
- run
elm reactor
- open http://localhost:8000
- open
Main.elm
app in reactor - open Browser Console
- Click
Start
Button - Notice response
Main.update msg: : Component Send
Main.elm:3794 Main.update msg: : Component (Receive "Message one")
Main.elm:3794 Main.update msg: : Receive "Message two"
Main.elm:3794 Main.update msg: : Receive "Message three"
Main.elm:3794 Main.update msg: : Receive "Message four"
I'm logging in
update : Msg -> Model -> (Model, Cmd Msg)
update msg model =
case Debug.log "Main.update msg: " msg of
Component compMsg ->
let
( compModel, cmd ) = Comp.update compMsg model.comp
in
( { model | comp = compModel}, Cmd.map Component cmd )
The subscription is initiated in the child Component.elm
so all logged messages
should be in the form Main.update msg: : Component (Receive "Message one")
as the first
receive message is, however all subsequent receive messages lose their Component context