Skip to content

Instantly share code, notes, and snippets.

@emanchado
Created October 14, 2016 10:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emanchado/8374593c42a7e2adccdff9512a7cbd02 to your computer and use it in GitHub Desktop.
Save emanchado/8374593c42a7e2adccdff9512a7cbd02 to your computer and use it in GitHub Desktop.
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