mix pd.gen.projection (PropertyDamage v0.2.0)
View SourceGenerate a PropertyDamage projection module.
Projections track state and optionally define assertions using @trigger or
@poll_state attributes.
Usage
mix pd.gen.projection MyApp.Projections.ModelStateExamples
mix pd.gen.projection MyApp.Projections.ModelState
mix pd.gen.projection MyApp.Projections.BalanceInvariantGenerated Template
The generated projection includes:
init/0- Initialize projection stateapply/2- Apply commands/events to state (with example)@triggerassertion example (synchronous)@poll_stateassertion example (temporal/eventual consistency)
More Information
See PropertyDamage.Model.Projection for full documentation on:
- State tracking with
apply/2 - Synchronous assertions with
@trigger - Temporal assertions with
@poll_state