Skip to content

Commit d9f9adf

Browse files
authored
Merge pull request #87 from abosch19/master
Removing domainEvents values in AggregateRoot on pulling domain events.
2 parents af890dd + 7e1b0d7 commit d9f9adf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Contexts/Shared/domain/AggregateRoot.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ export abstract class AggregateRoot {
88
}
99

1010
pullDomainEvents(): Array<DomainEvent> {
11-
return this.domainEvents;
11+
const domainEvents = this.domainEvents.slice();
12+
this.domainEvents = [];
13+
14+
return domainEvents;
1215
}
1316

1417
record(event: DomainEvent): void {

0 commit comments

Comments
 (0)