Interface ChangeSetListener<STATE, INPUTS>

interface ChangeSetListener<STATE, INPUTS> {
    onAfterRecordChange?(change, description, record): void;
    onBeforeRecordChange?(uuid, description, record, newInputs): void;
    onClear?(uuid): void;
    onRecordChange?(change, description, record, isUndo?): void;
}

Type Parameters

  • STATE = any
  • INPUTS = undefined

Methods

  • Called at the end of a transaction.

    Parameters

    Returns void

  • Called synchronously at the beginning of a transaction before a record is changed.

    If this throws an exception then all records within the transaction will not be applied.

    Parameters

    • uuid: string
    • description: string
    • record: any
    • newInputs: INPUTS

    Returns void

  • Called when all transactions are cleared. Handlers should clear their state. For example undo should clear the undo stack.

    Parameters

    • uuid: string

    Returns void

  • Called during a transaction this is when changes should be applied

    Parameters

    Returns void