Skip to content

Instantly share code, notes, and snippets.

@frenata
Created May 4, 2018 13:46
Show Gist options
  • Save frenata/bc6045cbde6a7bdd8df2626c6347376f to your computer and use it in GitHub Desktop.
Save frenata/bc6045cbde6a7bdd8df2626c6347376f to your computer and use it in GitHub Desktop.
Elm Boilerplate
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