This page covers Elm 0.18
The following diagram illustrates how the pieces of our application interact with Html.program.
Html.programcalls our view function with the initial model and renders it.
- When the user clicks on the Expand button, the view triggers the
Expandmessage which calls our
Expandand the current application state.
- The update function responds to the message by returning the updated state and a command to run (or
Html.programreceives the updated state, stores it, and calls the view with the updated state.
Html.program is the only place where an Elm application holds state, it is centralised in one big state tree.