Skip to content

Commit 6de5b1a

Browse files
committed
docs: improve method comments
1 parent 2c81776 commit 6de5b1a

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

packages/realtime_client/lib/src/realtime_channel.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,11 +646,15 @@ class RealtimeChannel {
646646
joinPush.resend(timeout ?? _timeout);
647647
}
648648

649-
/// Usually a rejoin only happens when the channel timeouts or errors out.
649+
/// Resends [joinPush] to tell the server we join this channel again and marks
650+
/// the channel as [ChannelStates.joining].
651+
///
652+
/// Usually [rejoin] only happens when the channel timeouts or errors out.
650653
/// When manually disconnecting, the channel is still marked as
651654
/// [ChannelStates.joined]. Calling [RealtimeClient.leaveOpenTopic] will
652655
/// unsubscribe itself, which causes issues when trying to rejoin. This method
653656
/// therefore doesn't call [RealtimeClient.leaveOpenTopic].
657+
@internal
654658
void forceRejoin([Duration? timeout]) {
655659
if (isLeaving) {
656660
return;

packages/supabase/lib/src/supabase_query_builder.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,16 @@ class SupabaseQueryBuilder extends PostgrestQueryBuilder {
2323
url: Uri.parse(url),
2424
);
2525

26-
/// Returns real-time data from your table as a `Stream`.
26+
/// Combines the current state of your table from PostgREST with changes from the realtime server to return real-time data from your table as a [Stream].
2727
///
2828
/// Realtime is disabled by default for new tables. You can turn it on by [managing replication](https://supabase.com/docs/guides/realtime/extensions/postgres-changes#replication-setup).
2929
///
30-
/// Pass the list of primary key column names to [primaryKey], which will be used to updating and deleting the proper records internally as the library receives real-time updates.
30+
/// Pass the list of primary key column names to [primaryKey], which will be used to update and delete the proper records internally as the stream receives real-time updates.
31+
///
32+
/// It handles the lifecycle of the realtime connection and automatically refetches data from PostgREST when needed.
33+
///
34+
/// Make sure to provide `onError` and `onDone` callbacks to [Stream.listen] to handle errors and completion of the stream.
35+
/// The stream gets closed when the realtime connection is closed.
3136
///
3237
/// ```dart
3338
/// supabase.from('chats').stream(primaryKey: ['id']).listen(_onChatsReceived);

0 commit comments

Comments
 (0)