applyTransactionUpdate method

void applyTransactionUpdate(
  1. BsatnRowList deletes,
  2. BsatnRowList inserts,
  3. EventContext context, {
  4. Set? protectedKeys,
  5. bool reconcile = false,
})

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, {
  Set<dynamic>? protectedKeys,
  bool reconcile = false,
}) {
  final changes = _applyChanges(
    deletes,
    inserts,
    protectedKeys: protectedKeys,
    reconcile: reconcile,
  );
  _emitChanges(changes, context);

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