Module

WebSocket

Package
purescript-websocket-moderate
Repository
athanclark/purescript-websocket-moderate

#WEBSOCKET Source

#Capabilities Source

type Capabilities m = { close :: m Unit, close' :: { code :: Maybe Int, reason :: Maybe String } -> m Unit, getBufferedAmount :: m Int, send :: String -> m Unit }

#Environment Source

type Environment = { protocol :: String, url :: String }

#Params Source

type Params m = { continue :: Environment -> { onclose :: { code :: Int, reason :: Maybe String, wasClean :: Boolean } -> m Unit, onerror :: String -> m Unit, onmessage :: Capabilities m -> String -> m Unit, onopen :: Capabilities m -> m Unit }, protocols :: Array String, url :: String }

#newWebSocket Source

newWebSocket :: forall eff. Params (Eff (ws :: WEBSOCKET | eff)) -> Eff (ws :: WEBSOCKET | eff) Unit