You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
500 B
TypeScript
19 lines
500 B
TypeScript
export type UpdateDefinition = {
|
|
id: string;
|
|
newVersion: string;
|
|
};
|
|
|
|
export default class ApplicationUpdates implements DomainProjection {
|
|
private readonly pendingUpdates: UpdateDefinition[] = [];
|
|
handle(event: DomainEvent<any>): void {
|
|
if (event.type === "ApplicationUpdateStarted") {
|
|
console.log("ApplicationUpdateStarted", event.payload);
|
|
this.pendingUpdates.push(event.payload);
|
|
}
|
|
}
|
|
|
|
getPendingUpdates(): UpdateDefinition[] {
|
|
return this.pendingUpdates;
|
|
}
|
|
}
|