elm-pages-v3-beta/examples/smoothies/app/View.elm
2022-05-24 16:57:24 -07:00

24 lines
441 B
Elm

module View exposing (View, map, placeholder)
import Html exposing (Html)
type alias View msg =
{ title : String
, body : List (Html msg)
}
map : (msg1 -> msg2) -> View msg1 -> View msg2
map fn doc =
{ title = doc.title
, body = List.map (Html.map fn) doc.body
}
placeholder : String -> View msg
placeholder moduleName =
{ title = "Placeholder - " ++ moduleName
, body = [ Html.text moduleName ]
}