Stone.js API
    Preparing search index...
    OnBusEvent: (key: string) => MethodDecorator

    Method decorator: mark a method as the handler for a routing key on a @KeyHandler() class.

    The light router (@KeyRouting()) dispatches an incoming event, keyed by a configurable property, to the matching method. One class can answer several keys, one method each.

    Type Declaration

      • (key: string): MethodDecorator
      • Parameters

        • key: string

          The routing key this method handles.

        Returns MethodDecorator

        A method decorator.

    @KeyHandler()
    export class Handlers {
    @OnKey('order.shipped') onShipped (payload) { ... }
    }