OneWayProjection

fun interface OneWayProjection<M, in T>

A OneWayProjection applies a sequence of events of type T to a model of type M. This is the simplest projection possible, since it only applies operations in single direction, in a commutative fashion.

More specifically, events may be applied more than once, and will necessarily be applied in commutative fashion. The events should therefore be idempotent, associative and commutative.

Parameters

M

the type of the model.

T

the type of the events.

Functions

Link copied to clipboard
abstract fun forward(    model: M,     identifier: EventIdentifier,     event: T): M

Applies the event to the given model, and returns a new immutable model.