Domain.Event reference
Source:
packages/domain/src/Event.ts
A fact your domain recorded, named in the past tense. Aggregates record events; their state, every view and every policy follow from them.
Event: Declaring events
Section titled “Event: Declaring events”An event with data
import * as Domain from "@alchemy.run/domain";import * as Schema from "effect/Schema";
export class MoneyDeposited extends Domain.Event("MoneyDeposited", { amount: Schema.Int, balanceAfter: Schema.Int,}) {}An event with no data
import * as Domain from "@alchemy.run/domain";
export class AccountClosed extends Domain.Event("AccountClosed") {}