feat/FRO-31: Added ingame (#20)
Force push of Janis ingame changes Co-authored-by: Janis <janis.e.20@gmx.de> Reviewed-on: #20
This commit is contained in:
@@ -6,8 +6,13 @@ import {
|
||||
sendEventAndWait,
|
||||
onEvent,
|
||||
isWebSocketConnected,
|
||||
setDefaultHandler,
|
||||
} from "@/services/ws";
|
||||
|
||||
function defaultEventHandler<T = any>(data: (data: T) => void) {
|
||||
setDefaultHandler(data);
|
||||
}
|
||||
|
||||
export function useWebSocket() {
|
||||
const isConnected = ref(isWebSocketConnected());
|
||||
const lastMessage = ref<any>(null);
|
||||
@@ -51,5 +56,6 @@ export function useWebSocket() {
|
||||
sendAndWait: sendEventAndWait,
|
||||
|
||||
useEvent,
|
||||
defaultEventHandler
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user