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