RT server and signalr
This commit is contained in:
21
front/src/services/testHubService.ts
Normal file
21
front/src/services/testHubService.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import {SignalRService} from "@/services/signalr.ts";
|
||||
|
||||
|
||||
const client = new SignalRService(
|
||||
`http://localhost:5039/testhub`,
|
||||
);
|
||||
|
||||
export const testHubService = {
|
||||
async connect() {
|
||||
await client.start();
|
||||
},
|
||||
/*
|
||||
async joinBoard(boardId: string) {
|
||||
await client.invoke("JoinBoard", boardId);
|
||||
},
|
||||
*/
|
||||
|
||||
onTest(callback: (text: string) => void) {
|
||||
client.on<string>("ReceiveText", callback);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user