Leaves the channel
Unsubscribes from server events, and instructs channel to terminate on server
Triggers onClose() hooks
To receive leave acknowledgements, use the receive
hook to bind to the server ack, ie:
Unsubscribes off of channel events
Use the ref returned from a channel.on() to unsubscribe one handler, or pass nothing for the ref to unsubscribe all handlers for the given event.
Optionalref: numberSubscribes on channel events
Subscription returns a ref counter, which can be used later to unsubscribe the exact event listener
Hook into channel close
Hook into channel errors
Overridable message hook
Receives all events for specialized message handling before dispatching to the channel callbacks.
Must return the payload, modified or unmodified
Optional_ref: stringOptional_joinRef: stringSends a message event to phoenix with the payload payload.
Phoenix receives this in the handle_in(event, payload, socket)
function. if phoenix replies or it times out (default 10000ms),
then optionally the reply can be received.
Channel class for Phoenix WebSocket communication