Module

Phoenix

#Socket

data Socket :: Type

A Phoenix Socket

#Channel

data Channel :: Type

A Phoenix Channel

#Push

data Push :: Type

A Phoenix Push object

#Endpoint

type Endpoint = String

An Endpoint URL is just a string

#Topic

type Topic = String

#Event

type Event = String

#Status

type Status = String

#Message

type Message = { event :: Event, payload :: Foreign, ref :: String, topic :: Topic }

#defaultSocketOptions

#heartbeatIntervalMs

#reconnectAfterMs

#newSocket

newSocket :: Endpoint -> Options Socket -> Effect Socket

Create a new Phoenix Socket

#connect

connect :: Socket -> Effect Unit

Socket operations

#disconnect

disconnect :: forall a. Socket -> (Socket -> Effect a) -> Int -> String -> Effect Unit

#remove

#sendHeartbeat

#flushSendBuffer

#protocol

#endPointURL

#isConnected

#onOpen

onOpen :: forall a. Socket -> (Socket -> Effect a) -> Effect Unit

Register callbacks

#onMessage

onMessage :: forall a. Socket -> (Socket -> Message -> Effect a) -> Effect Unit

#onSocketError

onSocketError :: forall a. Socket -> (Socket -> String -> Effect a) -> Effect Unit

#onSocketClose

onSocketClose :: forall a. Socket -> (Socket -> String -> Effect a) -> Effect Unit

#join

join :: Channel -> Effect Push

Channel operations

#rejoinUntilConnected

#onChannelError

onChannelError :: forall a. Channel -> (Channel -> String -> Effect a) -> Effect Unit

#onChannelClose

onChannelClose :: forall a. Channel -> (Channel -> Event -> Effect a) -> Effect Unit

Register callbacks

#on

on :: forall a. Channel -> Event -> (Channel -> Event -> Foreign -> Effect a) -> Effect Unit

Listen for messages on a channel

#send

send :: Push -> Effect Unit

Push operations

#receive

receive :: forall a. Push -> Status -> (Push -> Foreign -> Effect a) -> Effect Push

Modules