> For the complete documentation index, see [llms.txt](https://docs.fact-finder.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fact-finder.com/webcomponents-overview/web-components-4.x./api/core-api/result-dispatcher.md).

# 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`.

```javascript
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.

```javascript
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.

```javascript
document.addEventListener("ffReady", ({ factfinder }) => {
  factfinder.communication.globalCommunicationParameter.autoFetch =
    factfinder.enums.AutoFetch.AlwaysOn;
});
```

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.fact-finder.com/webcomponents-overview/web-components-4.x./api/core-api/result-dispatcher.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
