Skip to content

Commit

Permalink
Extract view function
Browse files Browse the repository at this point in the history
Remove the logic from `main` and into a `view` function that handles
turning a list of values into an Html list.
  • Loading branch information
JoelQ committed Jul 3, 2017
1 parent 460e348 commit 17b1dc8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Main.elm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Html exposing (..)


main =
ul [] (List.map dropdownItem fruits)
view fruits


fruits : List String
Expand All @@ -17,6 +17,11 @@ fruits =
]


view : List String -> Html a
view values =
ul [] (List.map dropdownItem values)


dropdownItem : String -> Html a
dropdownItem value =
li [] [ text value ]

0 comments on commit 17b1dc8

Please sign in to comment.