Skip to content

Instantly share code, notes, and snippets.

@vbop9834
Created October 5, 2016 19:50
Show Gist options
  • Save vbop9834/c5cd35f3e072d7a7d68614e4625064c1 to your computer and use it in GitHub Desktop.
Save vbop9834/c5cd35f3e072d7a7d68614e4625064c1 to your computer and use it in GitHub Desktop.
Example app for Elm 0.17
module App exposing (..)
import Html exposing (Html, h1, text)
import Html.App
type alias Model = String
init : ( Model, Cmd Msg )
init =
( "Hello", Cmd.none )
type Msg =
HelloWorld
view : Model -> Html Msg
view model =
h1 [] [ text model ]
update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
case msg of
HelloWorld ->
( "Hello World!", Cmd.none )
subscriptions : Model -> Sub Msg
subscriptions model =
Sub.none
main : Program Never
main =
Html.App.program
{
init = init,
view = view,
update = update,
subscriptions = subscriptions
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment