🚨 Announcing Vendure v2 Beta

VendureEntityEvent

VendureEntityEvent

The base class for all entity events used by the EventBus system.

  • For event type 'updated' the entity is the one before applying the patch (if not documented otherwise).
  • For event type 'deleted' the input will most likely be an id: ID

Signature

class VendureEntityEvent<Entity, Input = any> extends VendureEvent {
  public readonly public readonly entity: Entity;
  public readonly public readonly type: 'created' | 'updated' | 'deleted';
  public readonly public readonly ctx: RequestContext;
  public readonly public readonly input?: Input;
  constructor(entity: Entity, type: 'created' | 'updated' | 'deleted', ctx: RequestContext, input?: Input)
}

Extends

Members

entity

public readonly property
type:
Entity

type

public readonly property
type:
'created' | 'updated' | 'deleted'

ctx

public readonly property

input

public readonly property
type:
Input

constructor

protected method
type:
(entity: Entity, type: 'created' | 'updated' | 'deleted', ctx: RequestContext, input?: Input) => VendureEntityEvent