@@ -43,16 +43,16 @@ Observe postgres changes using the new `postgresChanges(_:schema:table:filter)`
43
43
``` swift
44
44
let channel = await supabase.realtimeV2 .channel (" public:messages" )
45
45
46
- for await insertion in channel.postgresChanges (InsertAction.self , table : " messages" ) {
46
+ for await insertion in channel.postgresChange (InsertAction.self , table : " messages" ) {
47
47
let insertedMessage = try insertion.decodeRecord (as : Message.self )
48
48
}
49
49
50
- for await update in channel.postgresChanges (UpdateAction.self , table : " messages" ) {
50
+ for await update in channel.postgresChange (UpdateAction.self , table : " messages" ) {
51
51
let updateMessage = try update.decodeRecord (as : Message.self )
52
52
let oldMessage = try update.decodeOldRecord (as : Message.self )
53
53
}
54
54
55
- for await deletion in channel.postgresChanges (DeleteAction.self , table : " messages" ) {
55
+ for await deletion in channel.postgresChange (DeleteAction.self , table : " messages" ) {
56
56
struct Payload : Decodable {
57
57
let id: UUID
58
58
}
@@ -65,7 +65,7 @@ for await deletion in channel.postgresChanges(DeleteAction.self, table: "message
65
65
If you wish to listen for all changes, use:
66
66
67
67
``` swift
68
- for change in channel.postgresChanges (AnyAction.self , table : " messages" ) {
68
+ for change in channel.postgresChange (AnyAction.self , table : " messages" ) {
69
69
// change: enum with insert, update, and delete cases.
70
70
}
71
71
```
@@ -128,10 +128,10 @@ try await channel.broadcast(event: "PING", message: PingEventMessage(timestamp:
128
128
129
129
### Listening for Broadcast messages
130
130
131
- Use ` broadcast ()` method for observing broadcast events.
131
+ Use ` broadcastStream ()` method for observing broadcast events.
132
132
133
133
``` swift
134
- for await event in channel.broadcast (event : " PING" ) {
134
+ for await event in channel.broadcastStream (event : " PING" ) {
135
135
let message = try event.decode (as : PingEventMessage.self )
136
136
}
137
- ```
137
+ ```
0 commit comments