Dispatched if an error occurs while handling the command. The event detail includes the error that was thrown.
Dispatched when the command has been handled by the commandbus. The event detail includes the result returned by the command handler.
Dispatched when the command has been received by the commandbus.
Calling preventDefault() on the event will stop the command from being handled
Events dispatched by the commandbus event middleware.
The command bus dispatches events at key points in the command lifecycle, allowing you to observe command execution, access results, handle errors, or even prevent commands from executing.
Example