import { RealtimeSubscription } from "https://deno.land/x/supabase@1.3.1/mod.ts";
Constructors
Methods
canPush()
isClosed()
isJoined()
isMember(topic: string)
joinRef()
off(event: string)
on(event: string, callback: Function)
onClose(callback: Function)
onError(callback: Function)
onMessage()
_event: string,
payload: any,
_ref?: string,
Overridable message hook
Receives all events for specialized message handling before dispatching to the channel callbacks. Must return the payload, modified or unmodified.
push()
event: CHANNEL_EVENTS,
payload: any,
timeout?,
rejoin(timeout?)
replyEventName(ref: string)
sendJoin(timeout: number)
subscribe(timeout?)
trigger()
event: string,
payload?: any,
ref?: string,
unsubscribe(timeout?)
Leaves the channel
Unsubscribes from server events, and instructs channel to terminate on server. Triggers onClose() hooks.
To receive leave acknowledgements, use the a receive
hook to bind to the server ack, ie:
channel.unsubscribe().receive("ok", () => alert("left!") )