TinyBase logoTinyBase β

WillSetValuesCallback

The WillSetValuesCallback type describes a function that is called before Values are set in the Store.

(values: Values): Values | undefined
TypeDescription
valuesValues

The Values object about to be set.

returnsValues | undefined

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

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

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

Since

v8.0.0