Guest User

Untitled

a guest
May 16th, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. module First.Update exposing (..)
  2.  
  3. import Material
  4.  
  5.  
  6. --
  7.  
  8. import Model exposing (Model)
  9.  
  10.  
  11. type Msg
  12. = Reset
  13. | IncrementCounter
  14. | Mdl (Material.Msg Msg)
  15.  
  16.  
  17. update : Msg -> Model -> ( Model, Cmd Msg )
  18. update msg model =
  19. case msg of
  20. Mdl msg_ ->
  21. Material.update Mdl msg_ model
  22.  
  23. IncrementCounter ->
  24. let
  25. counter =
  26. model.first.counter
  27.  
  28. first =
  29. model.first
  30. in
  31. { model
  32. | globalCounter = model.globalCounter + 1
  33. , first = { first | counter = counter + 1 }
  34. }
  35. ! []
  36.  
  37. _ ->
  38. model ! []
Add Comment
Please, Sign In to add comment