Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const startConnection = () => {
- try {
- setGameCode("");
- connection.on("GameCodeSent", (codeRoom: string) => {
- setGameCode(codeRoom);
- setdoneLoading(true);
- console.log(codeRoom);
- });
- connection.invoke("CreateGame");
- } catch (e) {
- console.log(e);
- }
- }
- useEffect(() => { startConnection(); }, [])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement