Runtime-bound abstract bases for ergonomic construction.
Call once per app with ctx.runtime; returns abstract classes that can be extended and constructed as new X(data) without threading runtime.
ctx.runtime
new X(data)
Runtime services
Runtime-bound { DomainEvent, IntegrationEvent } abstract bases
{ DomainEvent, IntegrationEvent }
const { DomainEvent } = defineDomainEvent(ctx.runtime);class UserCreated extends DomainEvent<{ userId: string }> { readonly type = 'UserCreated';}const event = new UserCreated({ userId: '123' }); Copy
const { DomainEvent } = defineDomainEvent(ctx.runtime);class UserCreated extends DomainEvent<{ userId: string }> { readonly type = 'UserCreated';}const event = new UserCreated({ userId: '123' });
0.1.0
Runtime-bound abstract bases for ergonomic construction.
Call once per app with
ctx.runtime; returns abstract classes that can be extended and constructed asnew X(data)without threading runtime.