@intisy/bayonet
    Preparing search index...

    Interface EventBusShape

    Publish and subscribe, as reached only through ContextSurface.

    interface EventBusShape {
        publish(topic: string, payload: unknown): void;
        subscribe(topic: string, listener: (value: unknown) => void): () => void;
    }
    Index
    • Publishes a payload on a topic.

      Parameters

      • topic: string

        the topic to publish on

      • payload: unknown

        the value every current subscriber of the topic receives

      Returns void

    • Subscribes to a topic. Call the result to stop listening.

      Parameters

      • topic: string

        the topic to listen on

      • listener: (value: unknown) => void

        called with each payload published on the topic

      Returns () => void

      a disposer that cancels the subscription when called