Events

Database accepts all events generated by resources in the database and handle it with custom event handlers.

Currently only two event types are defined:

export type IResourceEvent = IResourceDataChangeEvent | IResourceCommandExecutedEvent;

The resource data change event is never fired by any resource currently. The resource command executed event is fired after a command is carried out by a resource, be it successful or not:

export type IResourceCommandExecutedEvent = IResourceCommandExecutedSuccessEvent | IResourceCommandExecutedFailEvent;