Files
elm-0.19-workshop/advanced/part5/src/Loading.elm
2018-08-13 06:16:13 -04:00

26 lines
501 B
Elm

module Loading exposing (error, icon, slowThreshold)
{-| A loading spinner icon.
-}
import Asset
import Html exposing (Attribute, Html)
import Html.Attributes exposing (alt, height, src, width)
import Process
import Task exposing (Task)
icon : Html msg
icon =
Html.img [ Asset.src Asset.loading, width 64, height 64, alt "Loading..." ] []
error : String -> Html msg
error str =
Html.text ("Error loading " ++ str ++ ".")
slowThreshold : Task x ()
slowThreshold =
Process.sleep 500