TinyBase logoTinyBase

TransactionLog

The TransactionLog type describes the changes that were made to a Store during a transaction in detail.

{
  cellsTouched: boolean;
  valuesTouched: boolean;
  changedCells: ChangedCells;
  invalidCells: InvalidCells;
  changedValues: ChangedValues;
  invalidValues: InvalidValues;
  changedTableIds: ChangedTableIds;
  changedRowIds: ChangedRowIds;
  changedCellIds: ChangedCellIds;
  changedValueIds: ChangedValueIds;
}
TypeDescription
cellsTouchedboolean
valuesTouchedboolean
changedCellsChangedCells
invalidCellsInvalidCells
changedValuesChangedValues
invalidValuesInvalidValues
changedTableIdsChangedTableIds
changedRowIdsChangedRowIds
changedCellIdsChangedCellIds
changedValueIdsChangedValueIds

This contains equivalent information to a TransactionChanges object, but also information about what the previous state of the Store was. The changedCells and changedValues entries contain information about all changes to those parts of the Store, with their before and after values, for example.

cellsTouched and valuesTouched 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.

See the documentation for the types of the inner objects for other details.

Since

v4.0.0