Skip to content

Commit 953f023

Browse files
committed
chore: log ws connections
1 parent 7bb3a77 commit 953f023

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/utils/websocket.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ export const createWebSocketStream = <T = any>(url: string | URL) => {
1010
ws = new WebSocket(url.toString());
1111
closed = false;
1212

13+
ws.onopen = () => {
14+
console.log('[ws] opened');
15+
};
16+
17+
ws.onclose = () => {
18+
console.log('[ws] closed');
19+
};
20+
1321
ws.onmessage = (ev) => {
1422
if (!closed) {
1523
controller.enqueue(JSON.parse(ev.data));

0 commit comments

Comments
 (0)