Skip to content

Commit 39ed88a

Browse files
authored
use normal style
1 parent 1d3948d commit 39ed88a

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

examples/01-button.elm

+16-2
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,34 @@ import Html exposing (Html, button, div, text)
33
import Html.Events exposing (onClick)
44

55

6+
7+
-- MAIN
8+
9+
610
main =
711
Browser.sandbox { init = init, update = update, view = view }
812

913

14+
1015
-- MODEL
1116

17+
1218
type alias Model = Int
1319

20+
1421
init : Model
1522
init =
1623
0
1724

1825

26+
1927
-- UPDATE
2028

21-
type Msg = Increment | Decrement
29+
30+
type Msg
31+
= Increment
32+
| Decrement
33+
2234

2335
update : Msg -> Model -> Model
2436
update msg model =
@@ -30,12 +42,14 @@ update msg model =
3042
model - 1
3143

3244

45+
3346
-- VIEW
3447

48+
3549
view : Model -> Html Msg
3650
view model =
3751
div []
3852
[ button [ onClick Decrement ] [ text "-" ]
3953
, div [] [ text (String.fromInt model) ]
4054
, button [ onClick Increment ] [ text "+" ]
41-
]
55+
]

0 commit comments

Comments
 (0)