Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type Msg
- = PlayVideo VideoId
- | VideoPlayAdvanced { currentSecond : Int, totalLength : Int }
- | ReadTextAloud
- | Login AuthToken UserInformation
- logMessage : Msg -> Maybe { message : String, data : Json.Encode.Value }
- logMessage msg =
- case msg of
- PlayVideo (VideoId id) ->
- Just { message = "PlayVideo", data = Json.Encode.int id }
- VideoPlayAdvanced ->
- Nothing
- Login AuthToken UserInformation ->
- Just { message = "Login", data = Json.Encode.null }
- ReadTextAloud ->
- Just { message = "ReadTextAloud", data = Json.Encode.null }
- -- if you're not optimized, you _could_ replace the previous line entry and any others with this...but see below
- _ ->
- Just { message = Debug.toString msg, data = Json.Encode.null }
Add Comment
Please, Sign In to add comment