Tutorial by Examples

Html has beginnerProgram mostly for learning purposes. beginnerProgram is not capable of handling Subscriptions or running Commands. It is only capable of handling user input from DOM Events. It only requires a view to render the model and an update function to handle state changes. Example Con...
program is a good pick, when your application does not require any external data for initialization. It is capable of handling Subscriptions and Commands, which enables way more opportunities for handling I/O, such as HTTP communication or interop with JavaScript. The initial state is required to ...
programWithFlags has only one difference from program. It can accept the data upon initialization from JavaScript: var root = document.body; var user = { id: 1, name: "Bob" }; var app = Elm.Main.embed( root, user ); The data, passed from JavaScript is called Flags. In this example ...
Example demonstrates component composition and one-way message passing from parent to children. 0.18.0 Component composition relies on Message tagging with Html.App.map 0.18.0 In 0.18.0 HTML.App was collapsed into HTML Component composition relies on Message tagging with Html.map Example ...
Components define their own Messages, sent after emitted DOM Events, eg. CounterMsg from Parent-child communication type CounterMsg = Increment | Decrement | Reset The view of this component will send messages of CounterMsg type, therefore the view type signature is Html CounterMs...

Page 1 of 1