bootstack.events.DataChangeEvent#

class bootstack.events.DataChangeEvent(kind='reload', id=None, ids=(), record=None)#

Bases: object

Broadcast by a data source when its data or view changes.

Delivered to handlers registered with DataSource.on_change. Because the source coalesces rapid mutations into one notification per event-loop turn, a single event may stand in for several underlying changes; in that case kind is reload and the per-row fields are empty. Treat it as a coarse “something changed” signal and re-read the source for current data.

id: Any#

Affected record id for single-row kinds; None otherwise.

ids: tuple[Any, ...]#

Affected record ids for bulk kinds (e.g. select_all); empty otherwise.

kind: ChangeKind#

What changed.

record: Mapping[str, Any] | None#

The affected record (or the applied updates) where cheaply available on insert/update; None otherwise.