Real-time Survey Tool Documentation
    Preparing search index...

    Function useSocket

    • Custom React hook for managing a Socket.IO client connection. It handles connection, disconnection, and room joining for a given eventId.

      Parameters

      • eventId: null | string

        The ID of the event to join. If null, no connection is attempted.

      Returns {
          isConnected: boolean;
          socket: null | Socket<DefaultEventsMap, DefaultEventsMap>;
      }

      An object containing the Socket.IO client instance and the connection status.