inertialrush-game-test
Version:
This package enables the integration of the Inertial Rush game into any React application, making it easy to showcase the game.
17 lines (15 loc) • 506 B
JavaScript
const sendMessage = (connection, type, message) => {
connection.emit(type, message);
}
const connectToSocket = () => {
const wsConnection = io("/");
/*const wsConnection = io("https://inertialrush.com");*/
/*const wsConnection = io("http://localhost:5470");*/
wsConnection.on("connect", () => {
console.log("Connected to server!");
});
wsConnection.on("disconnect", () => {
console.log("Server disconnected!");
});
return wsConnection
}