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.
load
replaces init
and returns a task that will return your initial model and command.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 displays an error message.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.
load
replaces init
and returns a task that will return your initial model and command.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 displays an error message.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.