Interface UseRoomResponse

The return type for the useRoom hook.

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

Hierarchy (view full)

Properties

attach: (() => Promise<void>)

Shortcut to Room.attach. Not needed if the ChatRoomProvider has attach=true set, which is the default.

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. Not needed if the ChatRoomProvider has attach=true or release=true set, which are the default values.

room?: Room

The room object.

roomError?: ErrorInfo

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

roomId: string

The id of the room.

roomStatus: RoomStatus

Provides the status of the room.