mutableHistoryOf

fun <T> mutableHistoryOf(    initial: T,     projection: MutableProjection<T>,     clock: Clock = Clock.System): MutableHistory<T>

Creates a new MutableHistory, with an aggregate with an initial value and a projection for incremental changes.

Parameters

initial

the initial aggregate value.

projection
clock

the Clock used to generate new events.

T

the type of the aggregate.


fun <T> mutableHistoryOf(    initial: T,     projection: MutableProjection<T>,     vararg events: Pair<EventIdentifier, ByteArray>,     clock: Clock = Clock.System): MutableHistory<T>

Creates a new MutableHistory, with an aggregate with an initial value and a projection for incremental changes.

Parameters

initial

the initial aggregate value.

projection
events

some events to pre-populate the history.

clock

the Clock used to generate new events.

T

the type of the aggregate.