diff --git a/template/src/App.elm b/template/src/App.elm deleted file mode 100644 index af67af84..00000000 --- a/template/src/App.elm +++ /dev/null @@ -1,37 +0,0 @@ -module App exposing (..) - -import Html exposing (Html, text, div, img) -import Html.Attributes exposing (src) - - -type alias Model = - { message : String - , logo : String - } - - -init : String -> ( Model, Cmd Msg ) -init path = - ( { message = "Your Elm App is working!", logo = path }, Cmd.none ) - - -type Msg - = NoOp - - -update : Msg -> Model -> ( Model, Cmd Msg ) -update msg model = - ( model, Cmd.none ) - - -view : Model -> Html Msg -view model = - div [] - [ img [ src model.logo ] [] - , div [] [ text model.message ] - ] - - -subscriptions : Model -> Sub Msg -subscriptions model = - Sub.none diff --git a/template/src/Main.elm b/template/src/Main.elm index 27b51fea..b5b718f1 100644 --- a/template/src/Main.elm +++ b/template/src/Main.elm @@ -1,9 +1,57 @@ module Main exposing (..) -import App exposing (..) -import Html exposing (programWithFlags) +import Html exposing (Html, text, div, img) +import Html.Attributes exposing (src) + + +---- MODEL ---- + + +type alias Model = + { message : String + , logo : String + } + + +init : String -> ( Model, Cmd Msg ) +init path = + ( { message = "Your Elm App is working!", logo = path }, Cmd.none ) + + + +---- UPDATE ---- + + +type Msg + = NoOp + + +update : Msg -> Model -> ( Model, Cmd Msg ) +update msg model = + ( model, Cmd.none ) + + + +---- VIEW ---- + + +view : Model -> Html Msg +view model = + div [] + [ img [ src model.logo ] [] + , div [] [ text model.message ] + ] + + + +---- PROGRAM ---- main : Program String Model Msg main = - programWithFlags { view = view, init = init, update = update, subscriptions = subscriptions } + Html.programWithFlags + { view = view + , init = init + , update = update + , subscriptions = \_ -> Sub.none + }