Created
August 10, 2018 15:32
-
-
Save JoelQ/66e0f6ac6e5faca93ed5e50bdffdd685 to your computer and use it in GitHub Desktop.
Refactoring magic strings in Elm views
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 : Model -> Html Msg | |
view model = | |
div [] | |
[ div [ class "icon" ] [ span [class "icon-profile" ] [] ] | |
, div [ class "icon" ] [ span [ class "icon-clock" ] [] ] | |
] | |
-- REFACTOR TO | |
view : Model -> Html Msg | |
view model = | |
div [] | |
[ icon "profile" | |
, icon "clock" | |
] | |
-- REFACTOR TO | |
view : Model -> Html Msg | |
view model = | |
div [] | |
[ Icon.profile | |
, Icon.clock | |
] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment