Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AttributeEvent

AttributeEvent is a simple data class used to pass information from an object to registered event-listeners when an attribute event occurs. The AttributeEvent class also defines constants representing the available attribute events.

To register for an attribute event, use the Client, UserAccount, or Room class's addEventListener() method.

Hierarchy

  • Event
    • AttributeEvent

Index

Constructors

constructor

  • Parameters

    • type: string
    • changedAttr: Attribute
    • Default value status: string | null = null

    Returns AttributeEvent

Properties

Optional target

target: EventDispatcher

type

type: string

Static DELETE

DELETE: string = "DELETE"

Dispatched when an attribute is deleted.

Static DELETE_RESULT

DELETE_RESULT: string = "DELETE_RESULT"

Dispatched when the result of an attempt to delete an attribute is received. To determine the result of the attempt, use getStatus(), which has the following possible return values:

  • Status.SUCCESS
  • Status.ERROR
  • Status.CLIENT_NOT_FOUND (client attributes only)
  • Status.ROOM_NOT_FOUND (room attributes only)
  • Status.IMMUTABLE
  • Status.SERVER_ONLY

Static SET_RESULT

SET_RESULT: string = "SET_RESULT"

Dispatched when the result of an attempt to set an attribute is received. To determine the result of the attempt, use getStatus(), which has the following possible return values:

  • Status.SUCCESS
  • Status.ERROR
  • Status.DUPLICATE_VALUE (client attributes only)
  • Status.CLIENT_NOT_FOUND (client attributes only)
  • Status.ROOM_NOT_FOUND (room attributes only)
  • Status.IMMUTABLE
  • Status.SERVER_ONLY
  • Status.EVALUATION_FAILED

Static UPDATE

UPDATE: string = "UPDATE"

Dispatched when an attribute changes or is set for the first time.

Methods

getChangedAttr

  • Returns an Attribute object pertaining to this client event. The Attribute object contains information about a changed attribute.

    Returns Attribute

getStatus

  • getStatus(): string | null
  • Returns the status of the operation to which this event pertains.

    The getStatus() method's return value is always one of the Status class's constants.

    For a list of specific status values that can be returned during a particular event, see the documentation for that event.

    Returns string | null