TinyBase logoTinyBase β

WillSetTablesCallback

The WillSetTablesCallback type describes a function that is called before Tables are set in the Store.

(tables: Tables): Tables | undefined
TypeDescription
tablesTables

The Tables object about to be set.

returnsTables | undefined

The Tables to use (possibly transformed), or undefined to prevent the write.

The callback receives the Tables object that is about to be set. It can return the Tables (possibly transformed) to allow the write, or undefined to prevent the Tables from being set.

Multiple WillSetTablesCallback functions can be registered and they will be called sequentially, the Tables being updated successively. If any callback returns undefined, the chain short-circuits and the Tables will not be set.

Since

v8.0.0