From 565b117969bdbf116fc77c1271c916560dbe6e26 Mon Sep 17 00:00:00 2001 From: Rainnny7 Date: Mon, 9 Sep 2024 20:39:24 -0400 Subject: [PATCH] i hate stupid errors, its finally fixed! --- JS-SDK/src/hook/websocket.ts | 13 +++++++------ JS-SDK/src/index.ts | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/JS-SDK/src/hook/websocket.ts b/JS-SDK/src/hook/websocket.ts index 79c727a..0eb4775 100644 --- a/JS-SDK/src/hook/websocket.ts +++ b/JS-SDK/src/hook/websocket.ts @@ -23,20 +23,21 @@ export const useTetherWS = ( /** * Establish a connection with the API. */ - function connect() { + const connect = () => { console.log("[Tether] Connecting to the WebSocket server..."); socket = new WebSocket(url); // Connect to the gateway socket.addEventListener("open", () => { - console.log("[Tether] WebSocket connection established!"); - console.log("attempt to lsn to", snowflake); + console.log( + "[Tether] WebSocket connection established!", + snowflake + ); }); - // socket.addEventListener("close", connect); + socket.addEventListener("close", connect); socket.addEventListener("message", (event) => { console.log("data:", event.data); }); - } - + }; connect(); // Cleanup diff --git a/JS-SDK/src/index.ts b/JS-SDK/src/index.ts index db7b0d5..4c9ccdc 100644 --- a/JS-SDK/src/index.ts +++ b/JS-SDK/src/index.ts @@ -3,4 +3,5 @@ export * from "@/hook/websocket"; // Types export * from "@/types/config"; +export * from "@/types/snowflake"; export * from "@/types/user";