Module

Phoenix

Package
purescript-phoenix
Repository
brandonhamilton/purescript-phoenix

#Socket Source

data Socket :: Type

A Phoenix Socket

#Channel Source

data Channel :: Type

A Phoenix Channel

#Push Source

data Push :: Type

A Phoenix Push object

#Endpoint Source

type Endpoint = String

An Endpoint URL is just a string

#Topic Source

type Topic = String

#Event Source

type Event = String

#Status Source

type Status = String

#Message Source

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

#defaultSocketOptions Source

#reconnectAfterMs Source

#newSocket Source

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

Create a new Phoenix Socket

#connect Source

connect :: Socket -> Effect Unit

Socket operations

#disconnect Source

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

#onOpen Source

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

Register callbacks

#onMessage Source

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

#onSocketError Source

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

#onSocketClose Source

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

#join Source

join :: Channel -> Effect Push

Channel operations

#rejoinUntilConnected Source

#onChannelError Source

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

#onChannelClose Source

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

Register callbacks

#on Source

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

Listen for messages on a channel

#send Source

send :: Push -> Effect Unit

Push operations

#receive Source

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