TransactionListener
The TransactionListener
type describes a function that is used to listen to the completion of a transaction for the Store
.
(
store: Store,
cellsTouched: boolean,
valuesTouched: boolean,
): void
Type | Description | |
---|---|---|
store | Store | A reference to the |
cellsTouched | boolean | Whether |
valuesTouched | boolean | Whether |
returns | void | 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 booleans to indicate whether Cell
or Value
data has been touched during the transaction. The two flags are intended as a hint about whether non-mutating listeners might be being called at the end of the transaction.
Here, 'touched' means that Cell
or Value
data has either been changed, or changed and then changed back to its original value during the transaction. The exception is a transaction that has been rolled back, for which the value of cellsTouched
and valuesTouched
in the listener will be false
because all changes have been reverted.