Adds a callback that's invoked on state change.
A callback that's invoked on state change.
A function to remove the listener.
Builds a facet controller for the specified facet ID.
The unique identifier of the facet.
The type of facet to build.
A facet controller of the specified type, or undefined
if the facet does not exist in the state.
The state of each every facet returned by the Commerce API.
In a server-side rendering (SSR) scenario, you must use this state to render the facet UI components before the facet controller is hydrated on the client side.
Once the facet generator controller has been hydrated, you must use the getFacetController
method to retrieve
the individual facet controllers and subscribe to their respective states.
The
FacetGenerator
headless sub-controller creates commerce facet sub-controllers from the Commerce API search or product listing response.Commerce facets are not requested by the implementer, but rather pre-configured through the Coveo Merchandising Hub (CMH). The implementer is only responsible for leveraging the facet controllers created by this sub-controller to properly render facets in their application.