[docs] fix ws/pubsub; closed ws don't publish to topic (#6739)

This commit is contained in:
Rohit Kaushal
2023-10-30 12:37:50 +05:30
committed by GitHub
parent 8880bf1026
commit 08fdbb3c7d
2 changed files with 2 additions and 2 deletions

View File

@@ -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");
},
},