16 lines
314 B
TypeScript
16 lines
314 B
TypeScript
export abstract class AggregateRoot {
|
|
private _domainEvents: any[] = [];
|
|
|
|
protected addDomainEvent(event: any): void {
|
|
this._domainEvents.push(event);
|
|
}
|
|
|
|
public get domainEvents(): any[] {
|
|
return [...this._domainEvents];
|
|
}
|
|
|
|
public clearDomainEvents(): void {
|
|
this._domainEvents = [];
|
|
}
|
|
}
|