aboutsummaryrefslogtreecommitdiff
path: root/client/src/Messages.elm
diff options
context:
space:
mode:
authorJasper Van der Jeugt2020-07-29 21:14:12 +0200
committerJasper Van der Jeugt2020-07-29 21:14:12 +0200
commit49b346b7ebe98051a618d88a39d9b02f13edf33c (patch)
tree41d126d23ed0d3bcc469622b510b67e71d273821 /client/src/Messages.elm
parent057d954fe8d3265fc122f4a3066eab15eb7653d3 (diff)
Welcome Bye
Diffstat (limited to '')
-rw-r--r--client/src/Messages.elm4
1 files changed, 3 insertions, 1 deletions
diff --git a/client/src/Messages.elm b/client/src/Messages.elm
index da10d22..2510544 100644
--- a/client/src/Messages.elm
+++ b/client/src/Messages.elm
@@ -10,15 +10,17 @@ import Set exposing (Set)
type ServerMessage =
Welcome
+ | Bye
jsonDecServerMessage : Json.Decode.Decoder ( ServerMessage )
jsonDecServerMessage =
- let jsonDecDictServerMessage = Dict.fromList [("Welcome", Welcome)]
+ let jsonDecDictServerMessage = Dict.fromList [("Welcome", Welcome), ("Bye", Bye)]
in decodeSumUnaries "ServerMessage" jsonDecDictServerMessage
jsonEncServerMessage : ServerMessage -> Value
jsonEncServerMessage val =
case val of
Welcome -> Json.Encode.string "Welcome"
+ Bye -> Json.Encode.string "Bye"