Build-phase middleware: subscribes every notice that named a domain event.
This is what makes calling the notifier optional. A notice declaring on becomes a handler of
the light key router, the same one @stone-js/event-bus routes incoming domain events through. So
a module emits what happened, and the notice says who learns about it: the emitting module imports
nothing, and is never reopened when a channel is added.
A middleware rather than a static entry, because the notices are only known once everything has
been collected: @Notice contributes them, and so does configuration, and both are read here.
The entry is a plain object of the shape the key router already accepts, so nothing here depends on
@stone-js/router. The handler is the factory form, which receives the container, so the
closure carries only the notice's name and the notifier is resolved for the event that arrives.
Build-phase middleware: subscribes every notice that named a domain event.
This is what makes calling the notifier optional. A notice declaring
onbecomes a handler of the light key router, the same one@stone-js/event-busroutes incoming domain events through. So a module emits what happened, and the notice says who learns about it: the emitting module imports nothing, and is never reopened when a channel is added.A middleware rather than a static entry, because the notices are only known once everything has been collected:
@Noticecontributes them, and so does configuration, and both are read here.The entry is a plain object of the shape the key router already accepts, so nothing here depends on
@stone-js/router. The handler is the factory form, which receives the container, so the closure carries only the notice's name and the notifier is resolved for the event that arrives.