@@ -1,10 +1,17 @@
1−module Ur.Run exposing (Model, Msg, Program, application)
1+module Ur.Run exposing
3import Browser exposing (Document, UrlRequest)
10import Browser exposing (Document, UrlRequest)
4import Browser.Navigation as Nav
11import Browser.Navigation as Nav
5import Dict exposing (Dict)
12import Dict exposing (Dict)
6import Either exposing (Either(..))
13import Either exposing (Either(..))
7−import Html
14+import Html exposing (Html)
8import Json.Decode as JD
15import Json.Decode as JD
9import Task
16import Task
10import Time
17import Time
@@ -59,6 +66,49 @@ type alias Program model msg =
59 Platform.Program Flags (Model model msg) (Msg msg)
66 Platform.Program Flags (Model model msg) (Msg msg)
70+ { init : ( model, Ur.Cmd.Cmd msg )
71+ , view : model -> Html msg
72+ , update : msg -> model -> ( model, Ur.Cmd.Cmd msg )
73+ , subscriptions : model -> Sub msg
74+ , urbitSubscriptions : model -> Ur.Sub.Sub msg
75+ , createEventSource : String -> Cmd (Msg msg)
76+ , onEventSourceMsg : (JD.Value -> Msg msg) -> Sub (Msg msg)
77+ , urbitUrl : model -> String
82+ { init = init inp inp.init
83+ , view = \model -> inp.view model.app |> Html.map AppMsg
84+ , update = update inp
85+ , subscriptions = subscriptions inp
90+ { init : ( model, Ur.Cmd.Cmd msg )
91+ , view : model -> Document msg
92+ , update : msg -> model -> ( model, Ur.Cmd.Cmd msg )
93+ , subscriptions : model -> Sub msg
94+ , urbitSubscriptions : model -> Ur.Sub.Sub msg
95+ , createEventSource : String -> Cmd (Msg msg)
96+ , onEventSourceMsg : (JD.Value -> Msg msg) -> Sub (Msg msg)
97+ , urbitUrl : model -> String
102+ { init = init inp inp.init
106+ |> (\{ body, title } -> { title = title, body = body |> List.map (Html.map AppMsg) })
107+ , update = update inp
108+ , subscriptions = subscriptions inp
62application :
112application :
63 { init : Url -> Nav.Key -> ( model, Ur.Cmd.Cmd msg )
113 { init : Url -> Nav.Key -> ( model, Ur.Cmd.Cmd msg )
64 , view : model -> Document msg
114 , view : model -> Document msg