TinyBase logoTinyBase

TransactionListener

The TransactionListener type describes a function that is used to listen to the completion of a transaction for the Store.

(
  store: Store,
  getTransactionChanges: GetTransactionChanges,
  getTransactionLog: GetTransactionLog,
): void
TypeDescription
storeStore

A reference to the Store that is completing a transaction.

getTransactionChangesGetTransactionChanges

A function to be called to get the changes made to the Store during the transaction, since v4.0.

getTransactionLogGetTransactionLog
returnsvoid

This has no return value.

A TransactionListener is provided when using the addWillFinishTransactionListener and addDidFinishTransactionListener methods. See those methods for specific examples.

When called, a TransactionListener is simply given a reference to the Store and, since v4.0, two functions that you can call to get information about the changes made within the transaction. See the GetTransactionChanges and GetTransactionLog function types for more details.