@3dsource/metabox-front-api
    Preparing search index...

    Function fromCommunicatorEvent

    • Internal

      Wrapper helper function to use with RxJS the same way as fromEvent, to listen to events from the Communicator.

      Function that creates an event listener subscription. Allows developers to subscribe to specific events from the Communicator.

      Function that creates event listener subscriptions. Alternative to api.addEventListener() — both subscribe to configurator events. Use to react to state changes, screenshot readiness, viewport loading, showcase status, etc.

      Prefer api.addEventListener() directly from the Communicator object. If using fromCommunicatorEvent, pass the event name and handler. Key events: configuratorDataUpdated, viewportReady, screenshotReady, showcaseStatusChanged, getCameraResult. Always subscribe BEFORE sending commands that trigger responses.

      Type Parameters

      Parameters

      • target: Communicator

        The Communicator instance to listen on.

      • eventName: T

        The event name from FromMetaBoxApiEvents to subscribe to.

      Returns Observable<FromMetaboxMessagePayloads[T]>

      An Observable that emits the typed payload each time the event fires.