Skip to content

Commit 7a361e8

Browse files
authored
docs: fix Update RealtimeV2 Migration Guide.md (#689)
1 parent e2ca290 commit 7a361e8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Diff for: docs/migrations/RealtimeV2 Migration Guide.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@ Observe postgres changes using the new `postgresChanges(_:schema:table:filter)`
4343
```swift
4444
let 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
6565
If 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

Comments
 (0)