Skip to main content
Version: v2

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​

MethodAlertsReturn TypeDescription
addMember(clientId, details)BetavoidAdds a new client to the audience
removeMember(clientId)BetabooleanRemoves a client from the audience. Only emits an event if a client is actually removed
setCurrentClientId(clientId)BetavoidNotifies 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 for existing users, but is not recommended for new users.

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

Signature​

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

Parameters​

ParameterTypeDescription
clientIdstring
detailsIClient

removeMember​

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

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

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

Signature​

removeMember(clientId: string): boolean;

Parameters​

ParameterTypeDescription
clientIdstring

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 for existing users, but is not recommended for new users.

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

Signature​

setCurrentClientId(clientId: string): void;

Parameters​

ParameterTypeDescription
clientIdstring