@adapt-arch/utiliti-es
    Preparing search index...

    Interface IPubSubHub

    A simple pub/sub component.

    interface IPubSubHub {
        publish(topic: string, message: MessageData): void;
        subscribe(topic: string, handler: MessageHandler): null | string;
        unsubscribe(subscriptionId: string): void;
    }

    Implemented by

    Index

    Methods

    • Subscribe to a topic.

      Parameters

      • topic: string

        The topic to subscribe to.

      • handler: MessageHandler

        The handler to call when a message is published.

      Returns null | string

      The id of the handler subscription if the subscription is successful.

    • Unsubscribe from a topic.

      Parameters

      • subscriptionId: string

        The subscription id to unsubscribe.

      Returns void