import { Event } from './Event'; import { getContext } from './utils/createActionProxy'; export class EventWithContext extends Event { public async emit(data: T) { const ctx = getContext(this.action); const context = await ctx.getOutgoingContext(); await ctx.controller.send({ ...this.createMessage(data), context }); } }