SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Interface IStateListener<STATE>

    interface IStateListener<STATE = any> {
        onAfterStateChange?(
            state: STATE,
            commit: ICommit,
            isRevert: boolean,
            isRestore: boolean,
            intents: Readonly<Record<string, any>>,
        ): void;
        onBeforeCommitEnd?(
            state: STATE,
            commit: ICommit,
            isRevert: boolean,
            isRestore: boolean,
            intents: Readonly<Record<string, any>>,
        ): void;
        onBeforeCommitStart?(
            state: STATE,
            commit: ICommit,
            isRevert: boolean,
            isRestore: boolean,
            intents: Readonly<Record<string, any>>,
        ): void;
        onClose?(commit: ICommit): void;
        onRestoreOrRevert?(
            state: STATE,
            commit: ICommit,
            isUndo: boolean,
            isRestore: boolean,
            intents: Readonly<Record<string, any>>,
        ): void;
    }

    Type Parameters

    • STATE = any
    Index
    • Called after the transaction. This is generally used for cleanup or ui notification.

      Parameters

      • state: STATE
      • commit: ICommit
      • isRevert: boolean
      • isRestore: boolean
      • intents: Readonly<Record<string, any>>

      Returns void

    • Called during a transaction.

      Parameters

      • state: STATE
      • commit: ICommit
      • isRevert: boolean
      • isRestore: boolean
      • intents: Readonly<Record<string, any>>

      Returns void

      This is when changes should be applied.

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

      Parameters

      • state: STATE
      • commit: ICommit
      • isRevert: boolean
      • isRestore: boolean
      • intents: Readonly<Record<string, any>>

      Returns void

      If this throws an exception then all records within the transaction will not be applied. intents are the record's so far: what the operation has declared about itself by the time it commits (see ITransaction.setIntent).

    • Called when a model is removed from the transaction.

      Parameters

      Returns void

    • Called if the restore or revert is called. This is called asynchronously As should only have passive actions.

      Parameters

      • state: STATE
      • commit: ICommit
      • isUndo: boolean
      • isRestore: boolean
      • intents: Readonly<Record<string, any>>

      Returns void