Guest User

Untitled

a guest
Oct 15th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. type Msg
  2. = PlayVideo VideoId
  3. | VideoPlayAdvanced { currentSecond : Int, totalLength : Int }
  4. | ReadTextAloud
  5. | Login AuthToken UserInformation
  6.  
  7.  
  8. logMessage : Msg -> Maybe { message : String, data : Json.Encode.Value }
  9. logMessage msg =
  10. case msg of
  11. PlayVideo (VideoId id) ->
  12. Just { message = "PlayVideo", data = Json.Encode.int id }
  13.  
  14. VideoPlayAdvanced ->
  15. Nothing
  16.  
  17. Login AuthToken UserInformation ->
  18. Just { message = "Login", data = Json.Encode.null }
  19.  
  20. ReadTextAloud ->
  21. Just { message = "ReadTextAloud", data = Json.Encode.null }
  22.  
  23. -- if you're not optimized, you _could_ replace the previous line entry and any others with this...but see below
  24. _ ->
  25. Just { message = Debug.toString msg, data = Json.Encode.null }
Add Comment
Please, Sign In to add comment