From df409f4dabcf6b09e8fd5e5a05096609756cde92 Mon Sep 17 00:00:00 2001 From: pjurewicz Date: Thu, 21 Mar 2024 23:06:23 +0100 Subject: [PATCH] formatting --- .../elm/src/Page/Debug.elm | 46 +++++++++++-------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/ruby_event_store-browser/elm/src/Page/Debug.elm b/ruby_event_store-browser/elm/src/Page/Debug.elm index db3fa8d655..63d9c47489 100644 --- a/ruby_event_store-browser/elm/src/Page/Debug.elm +++ b/ruby_event_store-browser/elm/src/Page/Debug.elm @@ -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) \ No newline at end of file + case msg of + GotStats result -> + case result of + Ok stats -> + ( { model | eventsInTotal = String.fromInt stats.eventsInTotal }, Cmd.none ) + + Err _ -> + ( model, Cmd.none )