module Update ( Action(..) , actions , updateModel ) where import Model exposing (Model) import Model.Payment exposing (Payments) import Model.View exposing (..) type Action = NoOp | SignIn | UpdateLogin String | UpdatePayments Payments actions : Signal.Mailbox Action actions = Signal.mailbox NoOp updateModel : Action -> Model -> Model updateModel action model = case action of NoOp -> model SignIn -> { model | view <- SignInView "" } UpdateLogin login -> { model | view <- SignInView login } UpdatePayments payments -> { model | view <- PaymentView payments }