Options
Menu

Class UserPresenceSubscription

The UserPresenceSubscription is a subscription to presence state and availability changes of a specific Domain User. The current state and availability can be queried from this object, OR you can use asObservable to subscribe to changes.

Instances of this can be obtained from PresenceService.subscribe.

Make sure to unsubscribe when you're done using this.

Hierarchy

Index

Accessors

available

  • get available(): boolean
  • Returns a boolean representing the associated user's current availabilty.

    Returns boolean

state

  • get state(): Map<string, any>
  • Returns the associated user's current presence state.

    Returns Map<string, any>

user

  • The user associated to this presence subscription.

    Returns DomainUser

Methods

addListener

asObservable

events

  • Provides the events emitted by this object as an Observable stream.

    example
    
    eventEmitter.events()
      .filter(e => e.name === "myevent")
      .subscribe(e => console.log(e));
    

    Returns Observable<IPresenceEvent>

    An Observable stream of all events emitted by this object.

off

on

once

  • Adds a single shot event listener for the specified event. The listener will be called the first time the specified event is fired after the event registration occurs, after which the registration will be removed and no further events will be passed to the listener.

    Parameters

    Returns ConvergenceEventEmitter<IPresenceEvent>

    This object, in support of a fluent API.

removeAllListeners

removeListener

removeListeners

unsubscribe

  • unsubscribe(): void
  • Unsubscribes from future presence changes for the associated user, cleaning up any needed resources.

    Returns void

Object literals

Events

Events: object

A mapping of the events a subscription could emit to each event's unique name.

AVAILABILITY_CHANGED

AVAILABILITY_CHANGED: string = PresenceAvailabilityChangedEvent.NAME

STATE_CLEARED

STATE_CLEARED: string = PresenceStateClearedEvent.NAME

STATE_REMOVED

STATE_REMOVED: string = PresenceStateRemovedEvent.NAME

STATE_SET

STATE_SET: string = PresenceStateSetEvent.NAME