import { Stage , StageCrewMember } from '@serenity-js/core' ; import { DomainEvent } from '@serenity-js/core/lib/events' ; export class EventRecorder implements StageCrewMember { constructor ( public readonly events = [ ] , private readonly stage = null ) { } assignedTo ( stage ) { return new EventRecorder ( this . events , stage ) ; } notifyOf ( event ) { this . events . push ( event ) ; } }