whoa, it compiled

This commit is contained in:
Ryan Haskell-Glatz 2019-10-20 14:17:29 -05:00
parent 371765e9ac
commit 72d6d6fd7e
2 changed files with 28 additions and 16 deletions

View File

@ -354,16 +354,16 @@ element =
Page.element Page.element
type alias Glue route layoutModel layoutMsg = type alias Glue params layoutModel layoutMsg =
Page.Glue route layoutModel layoutMsg Page.Glue params layoutModel layoutMsg
type alias Pages route layoutModel layoutMsg = type alias Pages params layoutModel layoutMsg =
Page.Pages route layoutModel layoutMsg Page.Pages params layoutModel layoutMsg
glue : glue :
Glue route layoutModel layoutMsg Glue params layoutModel layoutMsg
-> Page params layoutModel layoutMsg model msg -> Page params layoutModel layoutMsg model msg
glue = glue =
Page.glue Page.glue

View File

@ -133,24 +133,36 @@ element page { toModel, toMsg } =
-- LAYOUT -- LAYOUT
type alias Glue route model msg = type alias Glue params layoutModel layoutMsg =
{ layout : Layout msg { layout : Layout layoutMsg
, pages : Pages route model msg , pages : Pages params layoutModel layoutMsg
} }
type alias Pages route model msg = type alias Pages params layoutModel layoutMsg =
{ init : route -> ( model, Cmd msg ) { init : params -> ( layoutModel, Cmd layoutMsg )
, update : msg -> model -> ( model, Cmd msg ) , update : layoutMsg -> layoutModel -> ( layoutModel, Cmd layoutMsg )
, bundle : model -> Bundle msg , bundle : layoutModel -> Bundle layoutMsg
} }
glue : glue :
Glue route layoutModel layoutMsg Glue params layoutModel layoutMsg
-> Page params layoutModel layoutMsg model msg -> Page params layoutModel layoutMsg model msg
glue options { toModel, toMsg } = glue options { toModel, toMsg } =
{ init = Debug.todo "glue.init" { init =
, update = Debug.todo "glue.update" options.pages.init >> Tuple.mapBoth toModel (Cmd.map toMsg)
, bundle = Debug.todo "glue.bundle" , update =
\msg model ->
options.pages.update msg model
|> Tuple.mapBoth toModel (Cmd.map toMsg)
, bundle =
\model ->
let
page =
options.pages.bundle model
in
{ view = options.layout.view { page = page.view } |> Html.map toMsg
, subscriptions = Sub.none
}
} }