Complete the code to broadcast a custom event named 'update' using Supabase client.
supabase.channel('custom-channel').[1]('update', { message: 'Hello!' });
The broadcast method sends a custom event to all subscribers of the channel.
Complete the code to listen for the 'update' event on a Supabase channel.
supabase.channel('custom-channel').on('broadcast', { event: '[1]' }, payload => console.log(payload)).subscribe();
The on method listens for the broadcast event filtered by the event name 'update'.
Fix the error in the code to correctly broadcast a custom event with Supabase.
supabase.channel('custom-channel').[1]('update', { data: 'test' });
The broadcast method sends the event; subscribe is called separately to listen.
Fill both blanks to create a Supabase channel, broadcast an event, and subscribe to it.
const channel = supabase.channel('[1]'); channel.[2]('refresh', { info: 'data' }); channel.subscribe();
Create a channel named 'custom-channel' and use broadcast to send the 'refresh' event.
Fill all three blanks to listen for a custom event and log its payload.
supabase.channel('[1]').on('broadcast', { event: '[2]' }, payload => { console.log('[3]:', payload); }).subscribe();
Listen on 'custom-channel' for the broadcast event filtered by the 'refresh' event name and log the payload variable.
