@ably/chat - v1.1.1
    Preparing search index...

    Interface UseRoomResponse

    The return type for the useRoom hook.

    interface UseRoomResponse {
        attach: () => Promise<void>;
        connectionError?: ErrorInfo;
        connectionStatus: ConnectionStatus;
        detach: () => Promise<void>;
        roomError?: ErrorInfo;
        roomName: string;
        roomStatus: RoomStatus;
    }

    Hierarchy (View Summary)

    Index

    Properties

    attach: () => Promise<void>

    Shortcut to Room.attach. The ChatRoomProvider will handle attaching and detaching automatically, so this is only needed for manual control.

    This is a stable reference and will not be changed between renders for the same room.

    const { attach, roomStatus } = useRoom();

    const handleManualAttach = async () => {
    try {
    await attach();
    console.log('Room attached successfully');
    } catch (error) {
    console.error('Failed to attach room:', error);
    }
    };
    connectionError?: ErrorInfo

    If there's a connection error it will be available here.

    connectionStatus: ConnectionStatus

    Provides the connection status of the Ably connection.

    detach: () => Promise<void>

    Shortcut to Room.detach. The ChatRoomProvider will handle attaching and detaching automatically, so this is only needed for manual control.

    This is a stable reference and will not be changed between renders for the same room.

    const { detach, roomStatus } = useRoom();

    const handleManualDetach = async () => {
    try {
    await detach();
    console.log('Room detached successfully');
    } catch (error) {
    console.error('Failed to detach room:', error);
    }
    };
    roomError?: ErrorInfo

    If there's an error with the room it will be available here.

    roomName: string

    The unique identifier of the room.

    roomStatus: RoomStatus

    Provides the status of the room.