diff options
author | Alexis Hovorka <[email protected]> | 2024-07-27 19:43:38 -0600 |
---|---|---|
committer | Alexis Hovorka <[email protected]> | 2024-07-27 19:43:38 -0600 |
commit | 4702402484a773c0eccf7415d0318e367fb996e1 (patch) | |
tree | 54f4857f5664b7f40815c580493bf08adc4dbe88 /app/public/sock.js | |
parent | caa495340aef5b765bed193da51cd4bf48a4d570 (diff) |
Diffstat (limited to 'app/public/sock.js')
-rw-r--r-- | app/public/sock.js | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/app/public/sock.js b/app/public/sock.js index b4905e5..72e00ec 100644 --- a/app/public/sock.js +++ b/app/public/sock.js @@ -1,4 +1,3 @@ -const sock = (() => { "use strict"; const refresh = () => setTimeout(() => location.reload(), 1e3); let ws, pingTimeout; @@ -12,7 +11,7 @@ const handlers = { }], }; -const sock = { +export const sock = { init: url => { ws = new WebSocket(url); ws.addEventListener("close", refresh); @@ -39,5 +38,3 @@ const sock = { else prequeue.push([type, data]); }, }; - -return sock })(); |