Aggregate<TEvent extends Object, TValue extends Object, TId extends AggregateId, TState extends AggregateState<TValue>> constructor

  1. @mustCallSuper
Aggregate<TEvent extends Object, TValue extends Object, TId extends AggregateId, TState extends AggregateState<TValue>>(
  1. TId id,
  2. TState original
)

Default constructor that set initial state. Must be called by subclasses.

Implementation

@mustCallSuper
Aggregate(
  this.id,
  TState original,
) {
  _current = original;
  _original = original;
}