Interface UseOccupancyResponse

The response type from the useOccupancy hook.

interface UseOccupancyResponse {
    connectionError?: ErrorInfo;
    connections: number;
    connectionStatus: ConnectionStatus;
    occupancy?: Occupancy;
    presenceMembers: number;
    roomError?: ErrorInfo;
    roomStatus: RoomStatus;
}

Hierarchy (view full)

Properties

connectionError?: ErrorInfo

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

connections: number

The current number of users connected to the room, kept up to date by the hook.

connectionStatus: ConnectionStatus

Provides the connection status of the Ably connection.

occupancy?: Occupancy

Provides access to the underlying Occupancy instance of the room.

presenceMembers: number

The current number of users present in the room, kept up to date by the hook.

roomError?: ErrorInfo

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

roomStatus: RoomStatus

Provides the status of the room.