Created
April 2, 2016 22:27
-
-
Save chuck0523/ccd2d22185023f8c0cc5222ce7c00e60 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
view : Signal.Address Action -> Model -> Html | |
view address model = | |
let counters = List.map (viewCounter address) model.counters | |
remove = button [ onClick address Remove ] [ text "Remove" ] | |
insert = button [ onClick address Insert ] [ text "Add" ] | |
in | |
div [] ([remove, insert] ++ counters) | |
viewCounter : Signal.Address Action -> (ID, Counter.Model) -> Html | |
viewCounter address (id, model) = | |
Counter.view (Signal.forwardTo address (Modify id)) model |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment