TinyBase logoTinyBase

PersisterListener

A PersisterListener is a callback that lets a Persister inform the Store that a change has happened to the underlying data.

(
  getContent?: () => [Tables, Values],
  getTransactionChanges?: GetTransactionChanges,
): void
TypeDescription
getContent?() => [Tables, Values]

An optional function that, if provided, returns an array of Store content and can be used to immediately wholesale update the Store.

getTransactionChanges?GetTransactionChanges

An optional function that, if provided, returns a TransactionChanges object and can be used to immediately incrementally update the Store.

returnsvoid

This has no return value.

If the listener has the getTransactionChanges parameter, it will be used to make an incremental change to the Store. If not, but the getContent function is available, that will be used to make a wholesale change to the Store. If neither are present, the content will be loaded from the Persister's load method.

Since

v4.0.0