Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
pjurewicz committed Mar 21, 2024
1 parent 4376e1f commit df409f4
Showing 1 changed file with 27 additions and 19 deletions.
46 changes: 27 additions & 19 deletions ruby_event_store-browser/elm/src/Page/Debug.elm
Original file line number Diff line number Diff line change
@@ -1,37 +1,45 @@
module Page.Debug exposing (..)

import Html exposing (..)
import Api exposing (Stats, getStats)
import Flags exposing (Flags)
import Api exposing (getStats, Stats)
import Html exposing (..)
import Http

type alias Model = { resVersion : String, repositoryAdapter : String, eventsInTotal : String }

type alias Model =
{ resVersion : String, repositoryAdapter : String, eventsInTotal : String }


type Msg
= GotStats (Result Http.Error Stats)
= GotStats (Result Http.Error Stats)


init : Flags -> Model
init flags =
init flags =
{ resVersion = flags.resVersion, repositoryAdapter = flags.repositoryAdapter, eventsInTotal = "" }


initCmd : Flags -> Cmd Msg
initCmd flags =
getStats GotStats flags

view: Model -> Html a

view : Model -> Html a
view model =
div [] [
p [] [text ("RubyEventStore version: " ++ model.resVersion)],
p [] [text ("RubyEventStore adapter: " ++ model.repositoryAdapter)],
p [] [text ("Events in total: " ++ model.eventsInTotal)]
]
div []
[ p [] [ text ("RubyEventStore version: " ++ model.resVersion) ]
, p [] [ text ("RubyEventStore adapter: " ++ model.repositoryAdapter) ]
, p [] [ text ("Events in total: " ++ model.eventsInTotal) ]
]

update : Msg -> Model -> (Model, Cmd Msg)

update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
case msg of
GotStats result ->
case result of
Ok stats ->
({ model | eventsInTotal = String.fromInt stats.eventsInTotal }, Cmd.none)
Err _ ->
(model, Cmd.none)
case msg of
GotStats result ->
case result of
Ok stats ->
( { model | eventsInTotal = String.fromInt stats.eventsInTotal }, Cmd.none )

Err _ ->
( model, Cmd.none )

0 comments on commit df409f4

Please sign in to comment.