@@ -2,9 +2,6 @@ import Html exposing (..)
22import Html.Attributes exposing (..)
33import Html.Events exposing (on , onClick , onDoubleClick , onFocus , onBlur , onWithOptions , targetValue )
44import Signal exposing (Address )
5- import Keyboard
6- import Mouse
7- import Time
85import Char exposing (isDigit )
96import String
107import Json.Decode as JSON exposing ((:=) )
@@ -13,8 +10,7 @@ import Task exposing (Task, andThen, onError)
1310
1411
1512type alias Model =
16- { counter: Int
17- , creditCard: CreditCard
13+ { creditCard: CreditCard
1814 }
1915
2016
@@ -28,8 +24,7 @@ type alias CreditCard =
2824
2925initialModel : Model
3026initialModel =
31- { counter = 0
32- , creditCard = CreditCard " " " " " " " "
27+ { creditCard = CreditCard " " " " " " " "
3328 }
3429
3530
@@ -91,19 +86,7 @@ events =
9186
9287inputs : Signal Action
9388inputs =
94- let
95- x = Signal . map . x Keyboard . arrows
96- delta = Time . fps 30
97- toAction n =
98- case n of
99- - 1 -> Decrement
100- 1 -> Increment
101- _ -> NoOp
102-
103- arrows = Signal . sampleOn delta ( Signal . map toAction x)
104- clicks = Signal . map ( always Increment ) Mouse . clicks
105- in
106- Signal . mergeMany [ actions. signal, arrows, clicks]
89+ actions. signal
10790
10891
10992main : Signal Html
@@ -117,11 +100,7 @@ main =
117100view : ViewState -> Model -> Html
118101view state model =
119102 div []
120- [
121- -- button [ onClick address Decrement ] [ text "-" ]
122- -- , div [] [ text (toString model.counter) ]
123- -- , button [ onClick address Increment ] [ text "+" ]
124- ( activeView state. activeView) state model
103+ [ ( activeView state. activeView) state model
125104 , debugView state model
126105 ]
127106
@@ -438,17 +417,13 @@ cardExpirationDate state =
438417
439418type Action
440419 = NoOp
441- | Increment
442- | Decrement
443420 | CardSubmitted CreditCard
444421
445422
446423update : Action -> Model -> Model
447424update action model =
448425 case action of
449426 NoOp -> model
450- Increment -> { model | counter = model. counter + 1 }
451- Decrement -> { model | counter = model. counter - 1 }
452427 CardSubmitted newCard -> { model | creditCard = newCard }
453428
454429
0 commit comments