Skip to content

Commit

Permalink
Type constructors are functions too
Browse files Browse the repository at this point in the history
No need to duplicate it in wrapper that only flips two arguments.
  • Loading branch information
mostlyobvious committed Jan 27, 2024
1 parent a5af4d2 commit 3d12085
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions ruby_event_store-browser/elm/src/Main.elm
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ update msg model =
Just flags ->
let
( layoutModel, layoutCmd ) =
Layout.update layoutMsg (wrapModel model model.layout flags)
Layout.update layoutMsg (WrappedModel model.layout model.key flags)
in
( { model | layout = layoutModel }, Cmd.map GotLayoutMsg layoutCmd )

Expand Down Expand Up @@ -172,7 +172,7 @@ view model =
[ div []
[ Layout.view
GotLayoutMsg
(wrapModel model model.layout flags)
(WrappedModel model.layout model.key flags)
pageContent
]
]
Expand Down Expand Up @@ -216,11 +216,3 @@ viewOnePage pageMsgBuilder pageViewFunction pageModel =
pageViewFunction pageModel
in
( Just pageTitle, Html.map pageMsgBuilder pageContent )


wrapModel : Model -> a -> Flags -> WrappedModel a
wrapModel globalModel internalModel flags =
{ internal = internalModel
, key = globalModel.key
, flags = flags
}

0 comments on commit 3d12085

Please sign in to comment.