Registration happens under event.eventName — the same string an instance
reports as its name, so AggregateRoot.apply can find this method
again from an event it holds.
The decorator runs when the class is defined, not when it is instantiated,
so a missing eventName fails at import time rather than at dispatch.
What breaks when registration keys on the class name instead:
../../../docs/handle-decorator.md
Marks a method as the aggregate's reaction to one kind of event.
Registration happens under
event.eventName— the same string an instance reports as itsname, so AggregateRoot.apply can find this method again from an event it holds.The decorator runs when the class is defined, not when it is instantiated, so a missing
eventNamefails at import time rather than at dispatch.What breaks when registration keys on the class name instead: ../../../docs/handle-decorator.md