Setu-TS
    Preparing search index...

    Function EventsPlugin

    • Creates the EventsPlugin.

      Registers an IEventBus under CAPABILITIES.EVENTS. Single instance only (no name option — adding one would be a dead option per CLAUDE.md).

      Parameters

      Returns IPlugin

      The plugin instance

      import { EventsPlugin } from '@setu-ts/events-plugin';

      app.register(EventsPlugin({
      async: true,
      handlers: [
      { type: 'user-created', handler: new UserCreatedEventHandler() },
      { type: 'order-placed', handler: createOrderPlacedEventHandler },
      ],
      }));

      handlers accepts an instance or a RegistryFactory ((services: IServiceRegistry) => IEventHandler). A factory is resolved at onInit — the first phase at which the registry holds every capability — and subscribes through the same subscribeHandler the instance arm uses. Instance handlers keep their register() timing.

      0.1.0