Created
October 15, 2018 13:22
-
-
Save arsduo/3545c79fa47fc6130eb372ebc71eaf3b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment