commit method

  1. @visibleForOverriding
AggregateStateResult<TEvent, TValue, TId, TState> commit()

Commit local changes to original state.

Implementation

@visibleForOverriding
AggregateStateResult<TEvent, TValue, TId, TState> commit() {
  _changes.clear();
  final previous = _original;
  _original = _current;
  return AggregateStateResult.ok(
    current: _current,
    previous: previous,
  );
}