s-private API Documentation - v3.8.1
    Preparing search index...

    Domain event emitted when an article is created.

    Part of the event-driven architecture for cross-cutting concerns like notifications, logging, and analytics.

    const event = new ArticleCreatedEvent({
    title: "New Article",
    url: "https://example.com",
    quote: "Important quote",
    categoryName: "Technology",
    userId: "user-123",
    caller: "addArticle",
    });

    // event.eventType === "article.created"
    await eventHandler.handle(event);

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Constructors

    • Creates a new ArticleCreatedEvent.

      Parameters

      • data: {
            caller: string;
            categoryName: string;
            quote: string;
            title: string;
            url: string;
            userId: string;
        }

        Event data containing article details and metadata

        • caller: string

          The function/method that triggered the event

        • categoryName: string

          The category name

        • quote: string

          Quote/excerpt from the article

        • title: string

          The article title

        • url: string

          The article URL

        • userId: string

          The user who created the article

      Returns ArticleCreatedEvent

    Properties

    eventType: string

    The type of event (e.g., "article.created")

    metadata: { caller: string; timestamp: Date; userId: string }

    Contextual information about the event

    Event-specific data