Skip to main content

ISharedMatrixEvents Interface

Events emitted by Shared Matrix.

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

To use, import via @fluidframework/matrix/legacy.

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

Signature

export interface ISharedMatrixEvents<T> extends IEvent

Extends: IEvent

Type Parameters

Parameter Description
T

Call Signatures

CallSignature Alerts Description
(event: "conflict", listener: (row: number, col: number, currentValue: MatrixItem<T>, conflictingValue: MatrixItem<T>, target: IEventThisPlaceHolder) => void): void Alpha This event is only emitted when the SetCell Resolution Policy is First Write Win(FWW). This is emitted when two clients race and send changes without observing each other changes, the changes that gets sequenced last would be rejected, and only client who's changes rejected would be notified via this event, with expectation that it will merge its changes back by accounting new information (state from winner of the race).

Call Signature Details

(event: "conflict", listener: (row: number, col: number, currentValue: MatrixItem<T>, conflictingValue: MatrixItem<T>, target: IEventThisPlaceHolder) => void): void

This event is only emitted when the SetCell Resolution Policy is First Write Win(FWW). This is emitted when two clients race and send changes without observing each other changes, the changes that gets sequenced last would be rejected, and only client who's changes rejected would be notified via this event, with expectation that it will merge its changes back by accounting new information (state from winner of the race).

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: "conflict", listener: (row: number, col: number, currentValue: MatrixItem<T>, conflictingValue: MatrixItem<T>, target: IEventThisPlaceHolder) => void): void;

Remarks

Listener parameters:

  • row - Row number at which conflict happened.

  • col - Col number at which conflict happened.

  • currentValue - The current value of the cell.

  • conflictingValue - The value that this client tried to set in the cell and got ignored due to conflict.

  • target - The ISharedMatrix itself.