zibri
    Preparing search index...

    Class EventService<TEvents>

    Default implementation of the event service.

    Type Parameters

    • TEvents extends Record<string, unknown>

    Implements

    Index

    Constructors

    Methods

    • Runs just after the app shuts down. This is useful for things like the data source service, which should still be available at the OnAppShutdown hooks.

      In most cases you probably want to implement OnAppShutdown.

      Returns void

    • Emits an event of the given type and data.

      Type Parameters

      • K extends string | number | symbol

      Parameters

      • type: K
      • data: TEvents[K]
      • cleanupAfterMs: number = Ms.DAY

      Returns Promise<void>