Skip to content

Commit

Permalink
AppModel -> Model
Browse files Browse the repository at this point in the history
  • Loading branch information
rjsamson committed Mar 12, 2016
1 parent 96a9e80 commit a6d0dd4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 27 deletions.
2 changes: 1 addition & 1 deletion web/elm/src/Actions.elm
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import Models exposing (..)

type Action
= NoOp
| UpdateTicker AppModel
| UpdateTicker Model
4 changes: 2 additions & 2 deletions web/elm/src/Models.elm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Models (..) where

type alias AppModel =
type alias Model =
{ symbol : String
, venue : String
, bid : Int
Expand All @@ -15,7 +15,7 @@ type alias AppModel =
, quoteTime : String
}

initialModel : AppModel
initialModel : Model
initialModel =
{ symbol = "NYC"
, venue = "OBEX"
Expand Down
8 changes: 4 additions & 4 deletions web/elm/src/Ticker.elm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Html exposing (Html)
import Actions exposing (..)
import Models exposing (..)

update : Action -> AppModel -> ( AppModel, Effects Action )
update : Action -> Model -> ( Model, Effects Action )
update action model =
case action of
UpdateTicker newTicker ->
Expand All @@ -17,11 +17,11 @@ update action model =
_ ->
(model, Effects.none)

init : ( AppModel, Effects action )
init : ( Model, Effects action )
init =
( initialModel, Effects.none )

app : StartApp.App AppModel
app : StartApp.App Model
app =
StartApp.start
{ init = init
Expand All @@ -38,4 +38,4 @@ main : Signal.Signal Html
main =
app.html

port tickertape : Signal AppModel
port tickertape : Signal Model
25 changes: 5 additions & 20 deletions web/elm/src/View.elm
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,21 @@ import Actions exposing (..)
import Models exposing (..)
import String

type alias ViewModel =
{ symbol : String
, venue : String
, bid : Int
, ask : Int
, last : Int
, bidSize : Int
, askSize : Int
, bidDepth : Int
, askDepth : Int
, lastSize : Int
, lastTrade : String
, quoteTime : String
}

view : Signal.Address Action -> ViewModel -> Html.Html
view : Signal.Address Action -> Model -> Html.Html
view address model =
div
[]
[ page address model ]

page : Signal.Address Action -> ViewModel -> Html.Html
page : Signal.Address Action -> Model -> Html.Html
page address model =
div
[]
[ navbar address model
, tickerTable address model
]

navbar : Signal.Address Action -> ViewModel -> Html.Html
navbar : Signal.Address Action -> Model -> Html.Html
navbar address model =
nav
[ class "navbar navbar-default" ]
Expand All @@ -45,12 +30,12 @@ navbar address model =
]
]

brandLink : Signal.Address Action -> ViewModel -> Html.Html
brandLink : Signal.Address Action -> Model -> Html.Html
brandLink address model =
a
[ href "#", class "navbar-brand" ][ text "Stackfooter" ]

tickerTable : Signal.Address Action -> ViewModel -> Html.Html
tickerTable : Signal.Address Action -> Model -> Html.Html
tickerTable address model =
table
[ class "table table-bordered" ]
Expand Down

0 comments on commit a6d0dd4

Please sign in to comment.