Created
April 3, 2016 06:41
-
-
Save chuck0523/32e21f2fc7abecf1994bfd4f13d60fae 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
module Counter (Model, init, Action, update, view, viewWithRemoveButton, Context) where | |
... | |
type alias Context = | |
{ actions : Signal.Address Action | |
, remove : Signal.Address () | |
} | |
viewWithRemoveButton : Context -> Model -> Html | |
viewWithRemoveButton context model = | |
div [] | |
[ button [ onClick context.actions Decrement ] [ text "-" ] | |
, div [ countStyle ] [ text (toString model) ] | |
, button [ onClick context.actions Increment ] [ text "+" ] | |
, div [ countStyle ] [] | |
, button [ onClick context.remove () ] [ text "X" ] | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment