Skip to content

Commit 794d3af

Browse files
authored
Merge pull request #103 from gyzerok/simplify-template
chore(template): remove app from template for simplification
2 parents 5734016 + ce6d967 commit 794d3af

File tree

2 files changed

+51
-40
lines changed

2 files changed

+51
-40
lines changed

template/src/App.elm

Lines changed: 0 additions & 37 deletions
This file was deleted.

template/src/Main.elm

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,57 @@
11
module Main exposing (..)
22

3-
import App exposing (..)
4-
import Html exposing (programWithFlags)
3+
import Html exposing (Html, text, div, img)
4+
import Html.Attributes exposing (src)
5+
6+
7+
---- MODEL ----
8+
9+
10+
type alias Model =
11+
{ message : String
12+
, logo : String
13+
}
14+
15+
16+
init : String -> ( Model, Cmd Msg )
17+
init path =
18+
( { message = "Your Elm App is working!", logo = path }, Cmd.none )
19+
20+
21+
22+
---- UPDATE ----
23+
24+
25+
type Msg
26+
= NoOp
27+
28+
29+
update : Msg -> Model -> ( Model, Cmd Msg )
30+
update msg model =
31+
( model, Cmd.none )
32+
33+
34+
35+
---- VIEW ----
36+
37+
38+
view : Model -> Html Msg
39+
view model =
40+
div []
41+
[ img [ src model.logo ] []
42+
, div [] [ text model.message ]
43+
]
44+
45+
46+
47+
---- PROGRAM ----
548

649

750
main : Program String Model Msg
851
main =
9-
programWithFlags { view = view, init = init, update = update, subscriptions = subscriptions }
52+
Html.programWithFlags
53+
{ view = view
54+
, init = init
55+
, update = update
56+
, subscriptions = \_ -> Sub.none
57+
}

0 commit comments

Comments
 (0)