Skip to main content

IAudienceOwner Interface

Manages the state and the members for IAudience

This API is provided for existing users, but is not recommended for new users.

To use, import via @fluidframework/container-definitions/legacy.

For more information about our API support guarantees, see here.

Signature

export interface IAudienceOwner extends IAudience

Extends: IAudience

Methods

Method Alerts Return Type Description
addMember(clientId, details) Alpha void Adds a new client to the audience
removeMember(clientId) Alpha boolean Removes a client from the audience. Only emits an event if a client is actually removed
setCurrentClientId(clientId) Alpha void Notifies Audience that current clientId has changed. See getSelf() and IAudienceEvents's "selfChanged" event for more details.

Method Details

addMember

Adds a new client to the audience

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here.

Signature

addMember(clientId: string, details: IClient): void;

Parameters

Parameter Type Description
clientId string
details IClient

removeMember

Removes a client from the audience. Only emits an event if a client is actually removed

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here.

Signature

removeMember(clientId: string): boolean;

Parameters

Parameter Type Description
clientId string

Returns

if a client was removed from the audience

Return type: boolean

setCurrentClientId

Notifies Audience that current clientId has changed. See getSelf() and IAudienceEvents's "selfChanged" event for more details.

This API is provided as an alpha preview and may change without notice.

To use, import via @fluidframework/container-definitions/alpha.

For more information about our API support guarantees, see here.

Signature

setCurrentClientId(clientId: string): void;

Parameters

Parameter Type Description
clientId string