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.

18 lines
438 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") {
this.pendingUpdates.push(event.payload);
}
}
getPendingUpdates(): UpdateDefinition[] {
return this.pendingUpdates;
}
}