import { useMemo } from 'react';
import { io } from 'socket.io-client';

export function useSocket() {
  const socket = useMemo(
    () => io({ autoConnect: false, path: '/socket.io', reconnectionAttempts: 3 }),
    []
  );

  return { socket };
}
