mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
[docs] fix ws/pubsub; closed ws don't publish to topic (#6739)
This commit is contained in:
@@ -28,7 +28,7 @@ const server = Bun.serve<{ username: string }>({
|
||||
},
|
||||
close(ws) {
|
||||
const msg = `${ws.data.username} has left the chat`;
|
||||
ws.publish("the-group-chat", msg);
|
||||
server.publish("the-group-chat", msg);
|
||||
ws.unsubscribe("the-group-chat");
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user