@lppedd/message-bus - v0.9.1
    Preparing search index...

    Interface Topic<T, R>

    A message topic to categorize messages in the message bus.

    interface Topic<T = unknown, R = unknown> {
        broadcastDirection: "children" | "parent";
        displayName: string;
        mode: "multicast" | "unicast";
        (priority?: number, limit?: number): ParameterDecorator;
    }

    Type Parameters

    • T = unknown

      The type of the payload data associated with the topic.

    • R = unknown

      The type of the value returned from message handlers subscribed to the topic.

    Hierarchy (View Summary)

    • Parameters

      • Optionalpriority: number
      • Optionallimit: number

      Returns ParameterDecorator

    Index

    Properties

    broadcastDirection: "children" | "parent"

    The broadcasting direction for a topic.

    A message published to the topic will always be delivered first to handlers registered on the bus where publish() is called.

    Then, if the direction is:

    • children: the message is also propagated to all child buses recursively
    • parent: the message is also propagated to the immediate parent bus

    A topic broadcasts to children by default.

    displayName: string

    A human-readable name for the topic, useful for debugging and logging.

    mode: "multicast" | "unicast"

    Whether the topic allows multiple subscriptions or only a single subscription.

    • multicast: the topic can have multiple subscribers
    • unicast: the topic can have at most one subscriber

    A topic is multicast by default.