Skip to content

Commit

Permalink
Code no one really needed
Browse files Browse the repository at this point in the history
  • Loading branch information
mostlyobvious committed Jan 27, 2024
1 parent b7b72ae commit a8d4774
Showing 1 changed file with 13 additions and 20 deletions.
33 changes: 13 additions & 20 deletions ruby_event_store-browser/elm/src/Main.elm
Original file line number Diff line number Diff line change
Expand Up @@ -189,26 +189,19 @@ fullTitle maybePageTitle =
viewPage : Page -> ( Maybe String, Html Msg )
viewPage page =
case page of
ShowStream showStreamUIModel ->
viewOnePage
GotShowStreamMsg
Page.ShowStream.view
showStreamUIModel

ShowEvent openedEventUIModel ->
viewOnePage
GotShowEventMsg
Page.ShowEvent.view
openedEventUIModel
ShowStream pageModel ->
let
( title, content ) =
Page.ShowStream.view pageModel
in
( Just title, Html.map GotShowStreamMsg content )

ShowEvent pageModel ->
let
( title, content ) =
Page.ShowEvent.view pageModel
in
( Just title, Html.map GotShowEventMsg content )

NotFound ->
( Nothing, Layout.viewNotFound )


viewOnePage : (pageMsg -> Msg) -> (model -> ( String, Html pageMsg )) -> model -> ( Maybe String, Html Msg )
viewOnePage pageMsgBuilder pageViewFunction pageModel =
let
( pageTitle, pageContent ) =
pageViewFunction pageModel
in
( Just pageTitle, Html.map pageMsgBuilder pageContent )

0 comments on commit a8d4774

Please sign in to comment.