Created
October 14, 2016 10:52
-
-
Save emanchado/8374593c42a7e2adccdff9512a7cbd02 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
init : Int -> Model | |
init count = | |
Model 0 | |
type alias Model = | |
{ count : Int | |
, minCount : Int | |
, maxCount : Int | |
, numberClicks : Int | |
} | |
type Msg | |
= Increment | |
| Decrement | |
type Msg | |
= Increment | |
| Decrement | |
| SetValue Int | |
case msg of | |
Increment -> | |
(model | count = model.count + 1, Cmd.none) | |
SetValue newValue -> | |
(model | count = newValue, Cmd.none) | |
update : Msg -> Model -> Model | |
update msg model = | |
case msg of | |
Increment -> | |
(model | count = model.count + 1, Cmd.none) | |
SetValue newValue -> | |
(model | count = newValue, Cmd.none) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment