onSourcing

open fun onSourcing(stateAggregate: StateAggregate<*>, eventStream: DomainEventStream): CommandState

Applies event sourcing to the state aggregate with the given event stream.

Return

The next command state.

Parameters

stateAggregate

The state aggregate to source events into.

eventStream

The domain event stream to source.

Throws

if the current state doesn't support sourcing.