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

    Interface UseRoomReactionsResponse

    The response type from the useRoomReactions hook.

    interface UseRoomReactionsResponse {
        connectionError?: ErrorInfo;
        connectionStatus: ConnectionStatus;
        roomError?: ErrorInfo;
        roomStatus: RoomStatus;
        sendRoomReaction: (params: SendReactionParams) => Promise<void>;
    }

    Hierarchy (View Summary)

    Index

    Properties

    connectionError?: ErrorInfo

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

    connectionStatus: ConnectionStatus

    Provides the connection status of the Ably connection.

    roomError?: ErrorInfo

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

    roomStatus: RoomStatus

    Provides the status of the room.

    sendRoomReaction: (params: SendReactionParams) => Promise<void>

    A shortcut to the RoomReactions.send method.

    Sends a room-level reaction.

    Room reactions are ephemeral events that are not associated with specific messages. They're commonly used for live interactions like floating emojis, applause, or other real-time feedback in chat rooms. Unlike message reactions, room reactions are not persisted and are only visible to users currently connected to the room.

    Note:

    • Room must be attached to send room reactions, typically the ChatRoomProvider handles this automatically.
    • It is possible (though unlikely) to receive your own reaction via subscription before this promise resolves.

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

    Type Declaration

    const { sendRoomReaction } = useRoomReactions();

    const celebrateSuccess = async () => {
    try {
    await sendRoomReaction({
    name: '🎉',
    metadata: { reason: 'milestone_reached' }
    });
    } catch (error) {
    console.error('Failed to send room reaction:', error);
    }
    };