In the previous post, we learned how to create Elm Record Model. Let’s add
Elm View to our
Picshare application. This post is part of the functional language series, and it is based on a remarkable book, Programming Elm Build Safe and Maintainable Front-End Applications by Jeremy Fairbank.
Elm View is responsible for displaying the Elm Record Model. It is tempting to put a state into Elm View. But as these could lead to many application problems and issues, Elm View is only responsible for displaying the Elm Record Model.
step 1. we created an application
view that accepts our
initialModel and returns Elm
Virtual DOM. We pass that
viewDetailedPhoto the function that is using model
caption attributes. In
step 4 we set application
main variable to use
Compile the application and open
We have Elm stateful application with
- How To Create Elm View
- Elm View only purpose is to display the Elm Record Model