alex-tan / loadable / Loadable

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

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

application : { update : innerMsg -> innerModel -> ( innerModel, Platform.Cmd.Cmd innerMsg ), subscriptions : innerModel -> Platform.Sub.Sub innerMsg, view : innerModel -> Browser.Document innerMsg, load : flags -> Url -> Browser.Navigation.Key -> Task e ( innerModel, Platform.Cmd.Cmd innerMsg ), failCmd : Maybe (e -> Platform.Cmd.Cmd (Types.Msg innerModel innerMsg e)), loadingView : Maybe (flags -> Browser.Document (Types.Msg innerModel innerMsg e)), errorView : Maybe (e -> Browser.Document (Types.Msg innerModel innerMsg e)), onUrlRequest : Browser.UrlRequest -> innerMsg, onUrlChange : Url -> innerMsg } -> Program flags innerModel innerMsg e

Behaves a lot like application from the Browser package, with a few additions.


type alias Program flags model msg error =
Platform.Program flags (Types.Model flags model error) (Types.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.