Interface RoomReactions

This interface is used to interact with room-level reactions in a chat room: subscribing to reactions and sending them.

Get an instance via Room.reactions.

interface RoomReactions {
    get channel(): RealtimeChannel;
    onDiscontinuity(listener: DiscontinuityListener): OnDiscontinuitySubscriptionResponse;
    send(params: SendReactionParams): Promise<void>;
    subscribe(listener: RoomReactionListener): RoomReactionsSubscriptionResponse;
    unsubscribeAll(): void;
}

Hierarchy

  • EmitsDiscontinuities
    • RoomReactions

Accessors

  • get channel(): RealtimeChannel
  • Returns an instance of the Ably realtime channel used for room-level reactions. Avoid using this directly unless special features that cannot otherwise be implemented are needed.

    Returns RealtimeChannel

    The Ably realtime channel.

Methods

  • Send a reaction to the room including some metadata.

    This method accepts parameters for a room-level reaction. It accepts an object

    Parameters

    • params: SendReactionParams

      an object containing {type, headers, metadata} for the room reaction to be sent. Type is required, metadata and headers are optional.

    Returns Promise<void>

    The returned promise resolves when the reaction was sent. Note that it is possible to receive your own reaction via the reactions listener before this promise resolves.