FacetManager (Insight Engine)

This is for:

Developer

The FacetManager controller helps reorder facets to match the most recent search response.

Methods

sort

Sorts the facets to match the order in the most recent search response.

Parameters

Returns FacetManagerPayload<T>[]: A sorted array.

subscribe

Adds a callback that’s invoked on state change.

Parameters

  • listener: () => void

    A callback that’s invoked on state change.

Returns Unsubscribe: A function to remove the listener.

Attributes

state

The state of the CoreFacetManager controller.

Properties

  • facetIds: string[]

    The facet ids sorted in the same order as the latest response.

Initialize

buildFacetManager

Creates an insight FacetManager instance.

Parameters

  • engine: InsightEngine

    The insight engine.

Returns FacetManager

FacetManagerPayload<T>

Properties

  • facetId: string

    A unique string identifying a facet.

  • payload: T

    The payload to associate with the facetId. This can be anything e.g., a DOM element, JSX, a string.

Unsubscribe

Call signatures

  • (): void;