Unexpose Shared.Msg variants.

This commit is contained in:
Dillon Kearns 2021-04-23 16:52:35 -07:00
parent 1c96c1d99a
commit b16d012670
5 changed files with 20 additions and 16 deletions

View File

@ -1,4 +1,4 @@
module Shared exposing (Data, Model, Msg(..), SharedMsg(..), template)
module Shared exposing (Data, Model, Msg, SharedMsg(..), template)
import Browser.Navigation
import DataSource
@ -22,7 +22,7 @@ import Secrets
import SharedTemplate exposing (SharedTemplate)
template : SharedTemplate Msg Model Data msg
template : SharedTemplate Msg Model Data SharedMsg msg
template =
{ init = init
, update = update
@ -30,6 +30,7 @@ template =
, data = data
, subscriptions = subscriptions
, onPageChange = Just OnPageChange
, sharedMsg = SharedMsg
}

View File

@ -8,7 +8,7 @@ import Pages.PagePath exposing (PagePath)
import Route exposing (Route)
type alias SharedTemplate sharedMsg sharedModel sharedData mappedMsg =
type alias SharedTemplate msg sharedModel sharedData sharedMsg mappedMsg =
{ init :
Maybe Browser.Navigation.Key
->
@ -20,8 +20,8 @@ type alias SharedTemplate sharedMsg sharedModel sharedData mappedMsg =
}
, metadata : Maybe Route
}
-> ( sharedModel, Cmd sharedMsg )
, update : sharedMsg -> sharedModel -> ( sharedModel, Cmd sharedMsg )
-> ( sharedModel, Cmd msg )
, update : msg -> sharedModel -> ( sharedModel, Cmd msg )
, view :
sharedData
->
@ -29,17 +29,18 @@ type alias SharedTemplate sharedMsg sharedModel sharedData mappedMsg =
, frontmatter : Maybe Route
}
-> sharedModel
-> (sharedMsg -> mappedMsg)
-> (msg -> mappedMsg)
-> Document mappedMsg
-> { body : Html mappedMsg, title : String }
, data : DataSource.DataSource sharedData
, subscriptions : PagePath -> sharedModel -> Sub sharedMsg
, subscriptions : PagePath -> sharedModel -> Sub msg
, onPageChange :
Maybe
({ path : PagePath
, query : Maybe String
, fragment : Maybe String
}
-> sharedMsg
-> msg
)
, sharedMsg : sharedMsg -> msg
}

View File

@ -14,7 +14,7 @@ import SharedTemplate exposing (SharedTemplate)
import Tailwind.Utilities
template : SharedTemplate Msg Model Data msg
template : SharedTemplate Msg Model Data SharedMsg msg
template =
{ init = init
, update = update
@ -22,6 +22,7 @@ template =
, data = data
, subscriptions = subscriptions
, onPageChange = Just OnPageChange
, sharedMsg = SharedMsg
}

View File

@ -8,7 +8,7 @@ import Pages.PagePath exposing (PagePath)
import Route exposing (Route)
type alias SharedTemplate sharedMsg sharedModel sharedData mappedMsg =
type alias SharedTemplate msg sharedModel sharedData sharedMsg mappedMsg =
{ init :
Maybe Browser.Navigation.Key
->
@ -20,8 +20,8 @@ type alias SharedTemplate sharedMsg sharedModel sharedData mappedMsg =
}
, metadata : Maybe Route
}
-> ( sharedModel, Cmd sharedMsg )
, update : sharedMsg -> sharedModel -> ( sharedModel, Cmd sharedMsg )
-> ( sharedModel, Cmd msg )
, update : msg -> sharedModel -> ( sharedModel, Cmd msg )
, view :
sharedData
->
@ -29,17 +29,18 @@ type alias SharedTemplate sharedMsg sharedModel sharedData mappedMsg =
, frontmatter : Maybe Route
}
-> sharedModel
-> (sharedMsg -> mappedMsg)
-> (msg -> mappedMsg)
-> Document mappedMsg
-> { body : Html mappedMsg, title : String }
, data : DataSource.DataSource sharedData
, subscriptions : PagePath -> sharedModel -> Sub sharedMsg
, subscriptions : PagePath -> sharedModel -> Sub msg
, onPageChange :
Maybe
({ path : PagePath
, query : Maybe String
, fragment : Maybe String
}
-> sharedMsg
-> msg
)
, sharedMsg : sharedMsg -> msg
}

View File

@ -318,7 +318,7 @@ update sharedData pageData navigationKey msg model =
|> (\\( a, b, c ) ->
case c of
Just sharedMsg ->
( a, b, Shared.template.update (Shared.SharedMsg sharedMsg) model.global )
( a, b, Shared.template.update (Shared.template.sharedMsg sharedMsg) model.global )
Nothing ->
( a, b, ( model.global, Cmd.none ) )