Files
elm-0.19-workshop/advanced/part3/src/Assets.elm
Richard Feldman 46d8a711d5 Add part3
2018-08-05 07:57:52 -04:00

34 lines
495 B
Elm

module Assets exposing (error, src)
{-| Assets, such as images, videos, and audio. (We only have images for now.)
We should never expose asset URLs directly; this module should be in charge of
all of them. One source of truth!
-}
import Html exposing (Attribute, Html)
import Html.Attributes as Attr
type Image
= Image String
-- IMAGES
error : Image
error =
Image "/assets/images/error.jpg"
-- USING IMAGES
src : Image -> Attribute msg
src (Image url) =
Attr.src url