Created
July 24, 2017 14:24
-
-
Save tai2/297e018df99552a4d49f868200e2875e to your computer and use it in GitHub Desktop.
Elm app template https://www.elm-tutorial.org/en-v01/02-elm-arch/01-introduction.html
This file contains 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, div, text, program) | |
-- MODEL | |
type alias Model = | |
String | |
init : ( Model, Cmd Msg ) | |
init = | |
( "Hello", Cmd.none ) | |
-- MESSAGES | |
type Msg | |
= NoOp | |
-- VIEW | |
view : Model -> Html Msg | |
view model = | |
div [] | |
[ text model ] | |
-- UPDATE | |
update : Msg -> Model -> ( Model, Cmd Msg ) | |
update msg model = | |
case msg of | |
NoOp -> | |
( model, Cmd.none ) | |
-- SUBSCRIPTIONS | |
subscriptions : Model -> Sub Msg | |
subscriptions model = | |
Sub.none | |
-- MAIN | |
main : Program Never Model Msg | |
main = | |
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