Event type that is used to raise events and provided structured callbacks for any caller that is interested in registering for events. This type is also used for whenever a BaseEntity instance raises an event with MJGlobal.

Constructors

Properties

baseEntity: BaseEntity<unknown>

The BaseEntity object that is raising the event.

payload: any

Any payload that is associated with the event. This can be any type of object and is used to pass additional information about the event.

saveSubType?: "create" | "update"

If type === 'save' this property can either be 'create' or 'update' to indicate the type of save operation that was performed.

type: "other" | "new_record" | "save" | "delete" | "load_complete" | "transaction_ready" | "save_started" | "delete_started" | "load_started"

The type of event that is being raised.

  • save_started, delete_started, load_started: Raised when an operation begins
  • save, delete, load_complete: Raised when an operation completes successfully
  • new_record: Raised when NewRecord() is called
  • transaction_ready: Used to indicate that a transaction is ready to be submitted for execution. The TransactionGroup class uses this to know that all async preprocessing is done and it can now submit the transaction.