Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Standard Elm boilerplate
import Html exposing (..)
import Html.App as Html
import Html.Events exposing (..)
-- MODEL
type alias Model =
{ content : String
}
model : (Model, Cmd Msg)
model =
(Model "Hello!", Cmd.none)
-- UPDATE
type Msg
= Reset
update : Msg -> Model -> (Model, Cmd Msg)
update msg model =
case msg of
Reset ->
(model, Cmd.none)
-- VIEW
view : Model -> Html Msg
view model =
h1 [] [ text model.content ]
-- SUBSCRIPTIONS
subscriptions : Model -> Sub Msg
subscriptions model =
Sub.none
-- APP
main =
Html.program
{ init = model
, view = view
, update = update
, subscriptions = subscriptions
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.