applyTransactionUpdate method

void applyTransactionUpdate(
  1. BsatnRowList deletes,
  2. BsatnRowList inserts,
  3. EventContext context
)

Apply transaction update with event context

Updates the cache with inserts/deletes from a transaction and emits changes to streams. The EventContext contains metadata about what caused the transaction (reducer name, caller, status, etc.).

Phase 3 will add enhanced event streams that include the context.

Implementation

void applyTransactionUpdate(
  BsatnRowList deletes,
  BsatnRowList inserts,
  EventContext context,
) {
  final changes = _applyChanges(deletes, inserts);
  _emitChanges(changes, context);

  if (isEvent) {
    _rowsByPrimaryKey.clear();
    _rows.clear();
  }
}