For the complete documentation index, see llms.txt. This page is also available as Markdown.

Result Dispatcher

Subscribe to FactFinder response data and dispatch SSR results.

factfinder.communication.ResultDispatcher publishes FactFinder response data to Web Components and custom code.

Subscribe to a topic

Use subscribe(topic, fn) for normal listeners. Common topics include result, records, query, suggest, bct, sort, navigation, ppp, paging, asn, singleWordSearch, productDetail, similarProducts, and tagCloud.

window.addEventListener("ffReady", ({ resultDispatcher }) => {
  const key = resultDispatcher.subscribe("result", (result, event) => {
    // Process the result.
  });

  // resultDispatcher.unsubscribe("result", key);
});

Use addCallback() when the handler must run before regular subscribers. Remove it with removeCallback().

Dispatch SSR responses

Use dispatchSSR() when your application receives a FactFinder response outside Web Components. Attach the listener before ff-communication initializes.

document.addEventListener("ffCommunicationReady", ({ factfinder }) => {
  factfinder.communication.ResultDispatcher.dispatchSSR(responseToDispatch);
});

Pass a topic, or an array of topics, to update only relevant subscribers.

Auto Fetching

Late-mounted components can receive the latest result automatically. Set AlwaysOn when your UI needs this behavior after every dispatch.

The default is SsrOnly. Set AlwaysOff to disable this behavior.

Last updated

Was this helpful?