import { v6 as uuid } from "uuid";

export async function initSocket() {
  const { io } = await import("socket.io-client");
  return io({
    query: { userId },
    reconnectionAttempts: 2,
    reconnectionDelay: 1000,
  });
}

export const userId = uuid();
