Created
May 4, 2018 13:46
-
-
Save frenata/bc6045cbde6a7bdd8df2626c6347376f to your computer and use it in GitHub Desktop.
Elm Boilerplate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Monitor exposing (..) | |
import Html exposing (..) | |
{-| Single source of truth | |
-} | |
type alias Model = | |
{ text : String } | |
{-| Enumeration of possible messages. | |
-} | |
type Msg | |
= SomeMessage | |
{-| -} | |
main = | |
Html.program | |
{ init = init | |
, view = view | |
, update = update | |
, subscriptions = subscriptions | |
} | |
{-| Starting values for the model. | |
-} | |
init : ( Model, Cmd msg ) | |
init = | |
( Model "foo", Cmd.none ) | |
{-| Handle messages sent from the view. | |
-} | |
update : Msg -> Model -> ( Model, Cmd msg ) | |
update msg model = | |
case msg of | |
SomeMessage -> | |
-- nop | |
( model, Cmd.none ) | |
{-| Computes the view from the model. | |
-} | |
view : Model -> Html msg | |
view model = | |
div [] [ text "Hello, World!" ] | |
{-| Handle outside events. | |
-} | |
subscriptions : Model -> Sub msg | |
subscriptions model = | |
Sub.none |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment