Skip to main content
Version: v1

IServiceAudience Interface

Base interface to be implemented to fetch each service's audience. The generic M allows consumers to further extend the client object with service-specific details about the connecting client, such as device information, environment, or a username.

Signature

export interface IServiceAudience<M extends IMember> extends IEventProvider<IServiceAudienceEvents<M>>

Extends: IEventProvider<IServiceAudienceEvents

Type Parameters

Parameter Constraint Description
M IMember A service-specific member type.

Methods

Method Return Type Description
getMembers() Map<string, M> Returns an map of all users currently in the Fluid session where key is the userId and the value is the member object. The implementation may choose to exclude certain connections from the returned map. E.g. ServiceAudience excludes non-interactive connections to represent only the roster of live users.
getMyself() M | undefined Returns the current active user on this client once they are connected. Otherwise, returns undefined.

Method Details

getMembers

Returns an map of all users currently in the Fluid session where key is the userId and the value is the member object. The implementation may choose to exclude certain connections from the returned map. E.g. ServiceAudience excludes non-interactive connections to represent only the roster of live users.

Signature

getMembers(): Map<string, M>;

Returns

Return type: Map<string, M>

getMyself

Returns the current active user on this client once they are connected. Otherwise, returns undefined.

Signature

getMyself(): M | undefined;

Returns

Return type: M | undefined