Simplify a few things.
parent
d668f297dc
commit
ea0046783b
|
@ -109,30 +109,16 @@ decodeMessageEvent = \msgEvent -> do
|
||||||
---------------------------
|
---------------------------
|
||||||
|
|
||||||
data ErrorType
|
data ErrorType
|
||||||
= MessageIsServerAdvertisement String
|
= UnknownError String
|
||||||
| UnknownError String
|
|
||||||
| UnknownWebSocketError
|
| UnknownWebSocketError
|
||||||
|
|
||||||
renderError :: ErrorType -> String
|
renderError :: ErrorType -> String
|
||||||
renderError = case _ of
|
renderError = case _ of
|
||||||
UnknownError str ->
|
UnknownError str ->
|
||||||
"Unknown error: " <> str
|
"Unknown error: " <> str
|
||||||
MessageIsServerAdvertisement str ->
|
|
||||||
"Received following advertisment from server: " <> str
|
|
||||||
UnknownWebSocketError ->
|
UnknownWebSocketError ->
|
||||||
"Unknown 'error' event has been fired by WebSocket event listener"
|
"Unknown 'error' event has been fired by WebSocket event listener"
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
-- `Main` function
|
|
||||||
--------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
main :: Effect Unit
|
|
||||||
main = do
|
|
||||||
HA.runHalogenAff do
|
|
||||||
body <- HA.awaitBody
|
|
||||||
let url = "ws://localhost:8080"
|
|
||||||
runUI component url body
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- WebSocket message type
|
-- WebSocket message type
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue