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

    Interface IListeners

    Listener interface for TransactionStore

    interface IListeners {
        onAmendEnd?(commit: ICommit): void;
        onCommitChange?(commit: ICommit): void;
        onCommitClose?(
            commit: ICommit,
            isRollback: boolean,
            isElided?: boolean,
            isAmend?: boolean,
        ): void;
        onCommitEnd?(commit: ICommit): void;
        onCommitStart?(commit: ICommit): void;
    }
    Index
    • Called after an amend has landed in the commit it targets (IStore.amend, ITransaction.amend).

      Parameters

      • commit: ICommit

        The commit that was amended.

      Returns void

      The counterpart of onCommitEnd for a change that is not a commit of its own: the history did not move, but the current snapshot did, and a listener deferring work until the store has settled needs to hear it.

    • Called if the commit changes for any reason.

      Parameters

      Returns void

    • Called when the root transaction closes, whether it committed or rolled back.

      Parameters

      • commit: ICommit

        The commit handle.

      • isRollback: boolean

        true if the transaction was rolled back.

      • OptionalisElided: boolean

        true if the root wrote nothing and no commit will land.

      • OptionalisAmend: boolean

      Returns void

      Called synchronously, once per operation, after the last nested transaction has closed and before the commit reaches the log. This is where an operation's intents (ITransaction.setIntent) are resolved: no transaction is open, so the work is not part of the commit, and the depth a nested operation ran at cannot make it fire early.

      A commit that wrote nothing is elided but still closes, so this still fires - and isElided is the only warning a listener gets that onCommitEnd is NOT coming. An amend closes here too, with isAmend: the id it closes under never lands, its writes fold into another commit (onAmendEnd). The three outcomes are distinct and a listener holding work until the operation settles has to tell them apart: a rollback (isRollback) discards what the operation announced, a landing commit releases it at onCommitEnd, and an elided root releases it here, because nothing further will happen.

    • Called after a successful commit.

      Parameters

      Returns void

      • A rollback will not trigger this event.
      • A restore/revert will trigger this event.
    • Called when a commit is started.

      Parameters

      • commit: ICommit

        The commit handle.

      Returns void

      This allows for additional transactional changes to be made such as transaction listeners.