@@ -43,16 +43,16 @@ Observe postgres changes using the new `postgresChanges(_:schema:table:filter)`
4343``` swift
4444let channel = await supabase.realtimeV2 .channel (" public:messages" )
4545
46- for await insertion in channel.postgresChanges (InsertAction.self , table : " messages" ) {
46+ for await insertion in channel.postgresChange (InsertAction.self , table : " messages" ) {
4747 let insertedMessage = try insertion.decodeRecord (as : Message.self )
4848}
4949
50- for await update in channel.postgresChanges (UpdateAction.self , table : " messages" ) {
50+ for await update in channel.postgresChange (UpdateAction.self , table : " messages" ) {
5151 let updateMessage = try update.decodeRecord (as : Message.self )
5252 let oldMessage = try update.decodeOldRecord (as : Message.self )
5353}
5454
55- for await deletion in channel.postgresChanges (DeleteAction.self , table : " messages" ) {
55+ for await deletion in channel.postgresChange (DeleteAction.self , table : " messages" ) {
5656 struct Payload : Decodable {
5757 let id: UUID
5858 }
@@ -65,7 +65,7 @@ for await deletion in channel.postgresChanges(DeleteAction.self, table: "message
6565If you wish to listen for all changes, use:
6666
6767``` swift
68- for change in channel.postgresChanges (AnyAction.self , table : " messages" ) {
68+ for change in channel.postgresChange (AnyAction.self , table : " messages" ) {
6969 // change: enum with insert, update, and delete cases.
7070}
7171```
@@ -128,10 +128,10 @@ try await channel.broadcast(event: "PING", message: PingEventMessage(timestamp:
128128
129129### Listening for Broadcast messages
130130
131- Use ` broadcast ()` method for observing broadcast events.
131+ Use ` broadcastStream ()` method for observing broadcast events.
132132
133133``` swift
134- for await event in channel.broadcast (event : " PING" ) {
134+ for await event in channel.broadcastStream (event : " PING" ) {
135135 let message = try event.decode (as : PingEventMessage.self )
136136}
137- ```
137+ ```
0 commit comments