Files
elm-0.19-workshop/intro/part7/src/Loading.elm
Richard Feldman 7208ff4557 Add part7
2018-08-12 00:03:39 -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