Commit d30cb31f authored by zlu's avatar zlu 🤸🏿
Browse files

User sees initial value and roll button

parent 16b9a2b5
import Html exposing (..)
import Html.Events exposing (onClick)
import Html.App as App
main =
App.program
{ init = init,
view = view,
update = update,
subscriptions = subscriptions
}
type alias Model = { dieFace : Int }
type Msg = Roll
init : (Model, Cmd Msg)
init =
(Model 1, Cmd.none)
update : Msg -> Model -> (Model, Cmd Msg)
update msg model =
case msg of
Roll ->
(model, Cmd.none)
view : Model -> Html Msg
view model =
div []
[ h1 [] [ text (toString model.dieFace) ],
button [ onClick Roll ] [ text "Roll" ]
]
subscriptions : Model -> Sub Msg
subscriptions model =
Sub.none
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment