Created
April 25, 2019 17:57
-
-
Save glinesbdev/1b7d40cf88ba77ad8cc4fe354a463087 to your computer and use it in GitHub Desktop.
Elm Type vs Type Alias
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
type alias Grid = | |
{ gridTemplateColumns : Maybe GridTemplateColumns | |
, gridTemplateRows : Maybe GridTemplateRows | |
, gridTemplateArea : Maybe GridTemplateArea | |
, gridTemplate : Maybe GridTemplate | |
} | |
type Grid | |
= GridTemplateColumn (Maybe String) | |
| GridTemplateRow (Maybe String) | |
| GridTemplateArea (Maybe String) | |
| GridTemplate (Maybe String) | |
-- Do this with Type vs Type Alias (Record) | |
gridAttributes : Grid -> List (Attribute msg) | |
gridAttributes grid = | |
[ displayGrid | |
, style "grid-template-columns" (maybeString grid.gridTemplateColumns) | |
, style "grid-template-rows" (maybeString grid.gridTemplateRows) | |
, style "grid-template-areas" (maybeStringList grid.gridTemplateArea) | |
, style "grid-template" (maybeStringList grid.gridTemplate) | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment