TinyBase logoTinyBase β

ChangedValues

The ChangedValues type describes the Values that have been changed during a transaction, primarily used so that you can indicate whether the transaction should be rolled back.

{[valueId: Id]: ChangedValue}

A ChangedValues object is provided to the doRollback callback when using the transaction method and the finishTransaction method. See those methods for specific examples.

This type is an object containing the old and new Values in two-part arrays. These are describing the state of each changed Value in Store at the start of the transaction, and by the end of the transaction.

Hence, an undefined value for the first item in the array means that the Value was added during the transaction. An undefined value for the second item in the array means that the Value was removed during the transaction. An array with two different Values indicates that it was changed. The two-part array will never contain two items of the same value (including two undefined values), even if, during the transaction, a Value was changed to a different value and then changed back.

Since

v3.0.0