diff options
Diffstat (limited to '')
-rw-r--r-- | client/src/Messages.elm | 4 |
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" |