Skip to content

Commit

Permalink
Debug module with its own model
Browse files Browse the repository at this point in the history
  • Loading branch information
pjurewicz committed Mar 20, 2024
1 parent 72bc77b commit 8a61cd9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
8 changes: 4 additions & 4 deletions ruby_event_store-browser/elm/src/Main.elm
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ type Page
= NotFound
| ShowEvent Page.ShowEvent.Model
| ShowStream Page.ShowStream.Model
| Debug
| Debug Page.Debug.Model


subscriptions : Model -> Sub Msg
Expand Down Expand Up @@ -216,7 +216,7 @@ navigate model location =
( { model | page = NotFound }, Cmd.none )

Just (Route.Debug) ->
( { model | page = Debug }, Cmd.none )
( { model | page = Debug (Page.Debug.init flags.resVersion) }, Cmd.none )

Nothing ->
( { model | page = NotFound }, Cmd.none )
Expand Down Expand Up @@ -270,10 +270,10 @@ viewPage page selectedTime =
in
( Just title, Html.map GotShowEventMsg content )

Debug ->
Debug pageModel ->
let
content =
Page.Debug.view
Page.Debug.view pageModel
in
( Just "Debug", content )

Expand Down
12 changes: 9 additions & 3 deletions ruby_event_store-browser/elm/src/Page/Debug.elm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ module Page.Debug exposing (..)

import Html exposing (..)

view: Html a
view =
text "to be filled with some helpful content"
type alias Model = { resVersion : String }

init : String -> Model
init resVersion =
{ resVersion = resVersion }

view: Model -> Html a
view model =
text ("RubyEventStore version: " ++ model.resVersion)

0 comments on commit 8a61cd9

Please sign in to comment.