alex-tan/loadable/3.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.

  • load replaces init.
  • failCmd can be used to send any error that results from the load task through a port.
  • loadingView can take flags and return a loading view.
  • errorView can take any error that results from load and display an error message.
type alias Program flags model msg error =
Program flags (Model flags model error) (Msg model msg error)

An alias for the Browser.Program that gets produced from this package which makes it easier to add type annotations for your programs.