18 lines
379 B
TypeScript
18 lines
379 B
TypeScript
import { getConfigValue } from "@ijl/cli";
|
|
import { io } from "socket.io-client";
|
|
|
|
let socket = null;
|
|
|
|
export const getSocket = () => socket;
|
|
|
|
export const connect = () => {
|
|
socket = io(getConfigValue('journal.socket.url') + '/lessons', { path: getConfigValue('journal.socket.path')});
|
|
socket.on("connect", () => {
|
|
console.log('Socket connected', socket.id)
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|