EngageSoftware/elm-engage-common/4.0.0

NOTE: the latest version is 8.2.10

Engage.RemoteData

RemoteData

type RemoteData e a
= NotAsked
| Failure e
| Loading
| Reloading a
| FailureWithData e a
| Success a

The RemoteData type

type alias WebData a =
RemoteData Error a

The WebData type

downgrade : RemoteData e a -> RemoteData e a

Downgrade the RemoteData

Use this with caution, you lose some information with this
fail : e -> RemoteData e a -> RemoteData e a

Fail a RemoteData

isLoading : RemoteData e a -> Bool

Check if the RemoteData is loading

isSuccess : RemoteData e a -> Bool

Check if the RemoteData is a success

Get a loading RemoteData

map : (a -> b) -> RemoteData e a -> RemoteData e b

Map onto the RemoteData

mapError : (e -> ee) -> RemoteData e a -> RemoteData ee a

Map the error of RemoteData

toError : RemoteData e a -> Maybe e

Get the error of RemoteData

toMaybe : RemoteData e a -> Maybe a

Get the Maybe value of RemoteData

upgrade : RemoteData e a -> RemoteData e a

Upgrade the RemoteData