TinyBase logoTinyBase

ValuesListener

The ValuesListener type describes a function that is used to listen to changes to all the Values in a Store.

(
  store: Store,
  getValueChange: GetValueChange | undefined,
): void
TypeDescription
storeStore

A reference to the Store that changed.

getValueChangeGetValueChange | undefined

A function that returns information about any Value's changes.

returnsvoid

This has no return value.

A ValuesListener is provided when using the addValuesListener method. See that method for specific examples.

When called, a ValuesListener is given a reference to the Store and a GetValueChange function that can be used to query Values before and after the current transaction.

Note that if the listener was manually forced to be called (with the callListener method rather than due to a real change in the Store), the GetValueChange function will not be present.