Member Junction
    Preparing search index...

    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.

    Index

    Constructors

    Properties

    baseEntity: BaseEntity<unknown>

    The BaseEntity object that is raising the event. Null for remote-invalidate events where no local BaseEntity instance is available.

    entityName?: string

    The entity name for the event. Used primarily for remote-invalidate events where baseEntity is null but the entity name is known from the remote notification.

    payload: unknown

    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.

    The metadata provider associated with the entity that raised this event. Required for remote-invalidate events where baseEntity is null and listeners (e.g. LocalCacheManager, BaseEngine) need to resolve entity metadata from the correct provider in multi-provider scenarios. For other event types, baseEntity.ProviderToUse is the source of truth and this field can be omitted; listeners should fall back to baseEntity?.ProviderToUse and finally to Metadata.Provider when no provider is available.

    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:
        | "new_record"
        | "save"
        | "delete"
        | "load_complete"
        | "transaction_ready"
        | "save_started"
        | "delete_started"
        | "load_started"
        | "remote-invalidate"
        | "other"

    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.
    • remote-invalidate: Raised when a remote server (via Redis pub/sub → GraphQL subscription) notifies this client that cached data for an entity has changed. Used to trigger BaseEngine re-fetch from server.