Skip to main content
Version: v2

IContainerEvents Interface

Events emitted by the IContainer "upwards" to the Loader and Host.

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 IContainerEvents extends IEvent

Extends: IEvent

Call Signatures​

Call SignatureAlertsReturn TypeDescription
(event: "readonly", listener: (readonly: boolean) => void): voidBetavoidEmitted when the readonly state of the container changes.
(event: "op", listener: (message: ISequencedDocumentMessage) => void): anyBetaanyEmitted immediately after processing an incoming operation (op).
(event: "dirty", listener: (dirty: boolean) => void): anyBetaanyEmitted upon the first local change while the Container is in the "saved" state. That is, when isDirty transitions from true to false.
(event: "saved", listener: (dirty: boolean) => void): anyBetaanyEmitted when all local changes/edits have been acknowledged by the service. I.e., when isDirty transitions from false to true.
(event: "metadataUpdate", listener: (metadata: Record<string, string>) => void): anyBetaanyEmitted when the some of the properties related to the container are initialized or updated. This emitted metadata will the props which are updated. If consumer wants to read full set of metadata then they can read it off the container from containerMetadata prop.
(event: "connected", listener: (clientId: string) => void): anyBetaanyEmitted when the IContainer completes connecting to the Fluid service.
(event: "codeDetailsProposed", listener: (codeDetails: IFluidCodeDetails, proposal: ISequencedProposal) => void): anyBetaanyFires when new container code details have been proposed, prior to acceptance.
(event: "disconnected", listener: () => void): anyBetaanyEmitted when the IContainer becomes disconnected from the Fluid service.
(event: "attaching", listener: () => void): anyBetaanyEmitted when a detached container begins the process of attached to the Fluid service.
(event: "attached", listener: () => void): anyBetaanyEmitted when the attaching process is complete and the container is attached to the Fluid service.
(event: "closed", listener: (error?: ICriticalContainerError) => void): anyBetaanyEmitted when the IContainer is closed, which permanently disables it.
(event: "disposed", listener: (error?: ICriticalContainerError) => void): anyBetaanyEmitted when the IContainer is disposed, which permanently disables it.
(event: "warning", listener: (error: ContainerWarning) => void): anyBetaanyEmitted when the container encounters a state which may lead to errors, which may be actionable by the consumer.

Call Signature Details​

(event: "readonly", listener: (readonly: boolean) => void): void​

Emitted when the readonly state of the container changes.

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​

(event: "readonly", listener: (readonly: boolean) => void): void;

Remarks​

Listener parameters:

  • readonly: Whether or not the container is now in a readonly state.

See Also​

readOnlyInfo

(event: "op", listener: (message: ISequencedDocumentMessage) => void): any​

Emitted immediately after processing an incoming operation (op).

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​

(event: "op", listener: (message: ISequencedDocumentMessage) => void): any;

Remarks​

Note: this event is not intended for general use. Prefer to listen to events on the appropriate ultimate recipients of the ops, rather than listening to the ops directly on the IContainer.

Listener parameters:

  • message: The op that was processed.

(event: "dirty", listener: (dirty: boolean) => void): any​

Emitted upon the first local change while the Container is in the "saved" state. That is, when isDirty transitions from true to false.

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​

(event: "dirty", listener: (dirty: boolean) => void): any;

Remarks​

Listener parameters:

  • dirty: DEPRECATED. This parameter will be removed in a future release.

See Also​

isDirty

(event: "saved", listener: (dirty: boolean) => void): any​

Emitted when all local changes/edits have been acknowledged by the service. I.e., when isDirty transitions from false to true.

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​

(event: "saved", listener: (dirty: boolean) => void): any;

Remarks​

Listener parameters:

  • dirty: DEPRECATED. This parameter will be removed in a future release.

See Also​

isDirty

(event: "metadataUpdate", listener: (metadata: Record<string, string>) => void): any​

Emitted when the some of the properties related to the container are initialized or updated. This emitted metadata will the props which are updated. If consumer wants to read full set of metadata then they can read it off the container from containerMetadata prop.

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​

(event: "metadataUpdate", listener: (metadata: Record<string, string>) => void): any;

(event: "connected", listener: (clientId: string) => void): any​

Emitted when the IContainer completes connecting to the Fluid service.

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​

(event: "connected", listener: (clientId: string) => void): any;

Remarks​

Reflects connection state changes against the (delta) service acknowledging ops/edits.

See Also​

(event: "codeDetailsProposed", listener: (codeDetails: IFluidCodeDetails, proposal: ISequencedProposal) => void): any​

Fires when new container code details have been proposed, prior to acceptance.

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​

(event: "codeDetailsProposed", listener: (codeDetails: IFluidCodeDetails, proposal: ISequencedProposal) => void): any;

Remarks​

Listener parameters:

  • codeDetails: The code details being proposed.
  • proposal: NOT RECOMMENDED FOR USE.

See Also​

proposeCodeDetails(codeDetails)

(event: "disconnected", listener: () => void): any​

Emitted when the IContainer becomes disconnected from the Fluid service.

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​

(event: "disconnected", listener: () => void): any;

Remarks​

Reflects connection state changes against the (delta) service acknowledging ops/edits.

See Also​

(event: "attaching", listener: () => void): any​

Emitted when a detached container begins the process of attached to the Fluid service.

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​

(event: "attaching", listener: () => void): any;

See Also​

(event: "attached", listener: () => void): any​

Emitted when the attaching process is complete and the container is attached to the Fluid service.

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​

(event: "attached", listener: () => void): any;

See Also​

(event: "closed", listener: (error?: ICriticalContainerError) => void): any​

Emitted when the IContainer is closed, which permanently disables it.

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​

(event: "closed", listener: (error?: ICriticalContainerError) => void): any;

Remarks​

Listener parameters:

  • error: If the container was closed due to error, this will contain details about the error that caused it.

See Also​

close(error)

(event: "disposed", listener: (error?: ICriticalContainerError) => void): any​

Emitted when the IContainer is disposed, which permanently disables it.

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​

(event: "disposed", listener: (error?: ICriticalContainerError) => void): any;

Remarks​

Listener parameters:

  • error: If the container was disposed due to error, this will contain details about the error that caused it.

See Also​

dispose(error)

(event: "warning", listener: (error: ContainerWarning) => void): any​

Emitted when the container encounters a state which may lead to errors, which may be actionable by the consumer.

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​

(event: "warning", listener: (error: ContainerWarning) => void): any;

Remarks​

Note: this event is not intended for general use. The longer-term intention is to surface warnings more directly on the APIs that produce them. For now, use of this should be avoided when possible.

Listener parameters:

  • error: The warning describing the encountered state.