import { supabase } from "https://deno.land/x/blocks@0.36.7/deps.ts";
const { RealtimeChannel } = supabase;
A channel is the basic building block of Realtime and narrows the scope of data flow to subscribed clients. You can think of a channel as a chatroom where participants are able to see who's online and send and receive messages.
Constructors
Properties
Methods
Creates an event handler that listens to changes.
The following is placed here to display on supabase.com/docs/reference/javascript/subscribe.
Sends a message into the channel.
Subscribe registers your client with the server
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!") )