In the previous post, we wrote the Picshare update function, but the heart icon had not been interactive yet. In this post, we will create a Picshare Browser Program. 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 program hooks update function with application view and model functions.
main constant to use
Browser.sandbox the method that has three input parameters:
- initial model
- view function
- update function
Program is a type union:
type Program flags model msg = Program
If you take a look at our
step 2., you will notice that we do not need any application flags for now because we set for flags
We use the Elm Program package in order to have a functional web application.
Build your likable Picshare application and open index.html file in Browser.