Created
October 5, 2016 19:50
-
-
Save vbop9834/c5cd35f3e072d7a7d68614e4625064c1 to your computer and use it in GitHub Desktop.
Example app for Elm 0.17
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 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