AggregateStateResult<TEvent extends Object, TValue extends Object, TId extends AggregateId, TState extends AggregateState<TValue>>.ok constructor

AggregateStateResult<TEvent extends Object, TValue extends Object, TId extends AggregateId, TState extends AggregateState<TValue>>.ok({
  1. required TState current,
  2. required TState previous,
})

Implementation

factory AggregateStateResult.ok({
  required TState current,
  required TState previous,
}) =>
    previous == current
        ? AggregateStateNoOp<TEvent, TValue, TId, TState>(current)
        : AggregateStateOk<TEvent, TValue, TId, TState>(
            current: current,
            previous: previous,
          );