Domain event emitted when a book is created.
Part of the event-driven architecture for cross-cutting concerns like notifications, logging, and analytics.
const event = new BookCreatedEvent({ isbn: "978-4-06-521234-5", title: "The Pragmatic Programmer", userId: "user-123", caller: "addBook",});// event.eventType === "book.created"await eventHandler.handle(event); Copy
const event = new BookCreatedEvent({ isbn: "978-4-06-521234-5", title: "The Pragmatic Programmer", userId: "user-123", caller: "addBook",});// event.eventType === "book.created"await eventHandler.handle(event);
Creates a new BookCreatedEvent.
Event data containing book details and metadata
The function/method that triggered the event
The book's ISBN identifier
The book title
The user who created the book
Readonly
The type of event (e.g., "article.created")
Contextual information about the event
Event-specific data
Domain event emitted when a book is created.
Remarks
Part of the event-driven architecture for cross-cutting concerns like notifications, logging, and analytics.
Example
See