handle server WSClose

This commit is contained in:
Spencer Pogorzelski 2023-08-14 11:13:17 -07:00
parent 3539de7c18
commit ce4a642542
3 changed files with 33 additions and 7 deletions

View file

@ -83,8 +83,9 @@ export class AdriftBareClient extends Client {
onReadyState(WebSocket.OPEN);
ws.dispatchEvent(new Event("open"));
},
() => {
(code: number, reason: string, wasClean: boolean) => {
onReadyState(WebSocket.CLOSED);
ws.dispatchEvent(new CloseEvent("close", { code, reason, wasClean }));
},
(data) => {
ws.dispatchEvent(