Skip to content

tekerson/purescript-websocket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Module Documentation

Module HTML5.WebSocket

Types

type Protocol = String


data Socket :: *


type URI = String


data WS :: !


type WebSocket eff = ContT Unit (WithWebSocket eff)


type WebSocketConfig = { protocols :: [Protocol], uri :: URI }


type WebSocketError = String


type WebSocketHandler eff = Socket -> { onMessage :: String -> WithWebSocket eff Unit, onOpen :: WithWebSocket eff Unit }


type WithWebSocket eff = Eff (ws :: WS | eff)

Values

defaultHandlers :: forall eff. WebSocketHandler eff


runWebSocket :: forall eff. WebSocket eff Unit -> WithWebSocket eff Unit


send :: forall eff. Socket -> String -> WithWebSocket eff Unit


withWebSocket :: forall eff. WebSocketConfig -> WebSocketHandler eff -> WebSocket eff (Either WebSocketError Unit)

About

A basic wrapper around HTML5 WebSocket

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published