Advertisement
Guest User

Untitled

a guest
Apr 6th, 2025
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     const startConnection = () => {
  2.         try {
  3.             setGameCode("");
  4.  
  5.             connection.on("GameCodeSent", (codeRoom: string) => {
  6.                 setGameCode(codeRoom);
  7.                 setdoneLoading(true);
  8.                 console.log(codeRoom);
  9.             });
  10.  
  11.             connection.invoke("CreateGame");
  12.         } catch (e) {
  13.             console.log(e);
  14.         }
  15.     }
  16.  
  17.     useEffect(() => { startConnection(); }, [])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement