newInstance method

TAggregate newInstance(
  1. TId id, [
  2. TState? state
])

Create new Aggregate instance of type TAggregate

Implementation

TAggregate newInstance(TId id, [TState? state]) {
  return _onNew == null
      ? AggregateTypes.create<TEvent, TValue, TId, TState, TAggregate>(
          id, state)
      : _onNew!(id, state);
}