Maestro v0.1.0 Maestro.Aggregate.EventHandler behaviour View Source

Minimal behaviour for a proper event handler. Like the CommandHandler, the use of the behaviour is not strictly required.

Link to this section Summary

Callbacks

Event handlers must succeed in their application of the event. Validation and other forms of rejection/failure should be done in the command handler. This is made evident in the spec for apply in that the result should always be a new valid state

Link to this section Types

Link to this section Callbacks

Link to this callback apply(any, event) View Source
apply(any(), event()) :: any()

Event handlers must succeed in their application of the event. Validation and other forms of rejection/failure should be done in the command handler. This is made evident in the spec for apply in that the result should always be a new valid state.