Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import Html exposing (beginnerProgram, div, button, text)
- import Html.Events exposing (onClick)
- main =
- beginnerProgram { model = 5, view = view, update = update }
- view model =
- div []
- [ button [ onClick Decrement ] [ text "-" ]
- , div [] [ text (toString ((5 % model) * 0 + model)) ]
- , button [ onClick Increment ] [ text "+" ]
- ]
- type Msg = Increment | Decrement
- update msg model =
- case msg of
- Increment ->
- ((5 % model) * 0 + model) + 1
- Decrement ->
- ((5 % model) * 0 + model) - 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement