alex-tan/loadable/2.0.0

NOTE: the latest version is 3.1.2

Loadable

{ update : innerMsg -> innerModel -> ( innerModel, Cmd innerMsg )
, subscriptions : innerModel -> Sub innerMsg
, view : innerModel -> Html innerMsg
, load : flags -> Task e ( innerModel, Cmd innerMsg )
, failCmd : Maybe (e -> Cmd (Msg innerModel innerMsg e))
, loadingView : Maybe (flags -> Html (Msg innerModel innerMsg e))
, errorView : Maybe (e -> Html (Msg innerModel innerMsg e))
}
-> Program flags innerModel innerMsg e

Behaves a lot like element from the Html package, with a few additions.

type Model flags innerModel error

The Model that wraps your Model.

type Msg innerModel msg error

The Msg that wraps your Msg. LoadSuccess/LoadError triggers depending on the result of your load function. ToInner is the msg that -- passes all your program messages on to your update function.

type alias Program flags model msg error =
Program flags (Model flags model error) (Msg model msg error)

A less complicated alias for the Program that gets produced from this package which you can use in your type annotations.