Sort (Insight Engine)

This is for:

Developer

The Sort controller manages how the results are sorted.

Methods

isSortedBy

Verifies whether the specified sort criterion is the currently active one.

Parameters

  • criterion: SortCriterion | SortCriterion[]

    The sort criterion to evaluate.

Returns boolean: true if the specified sort criterion is the currently active one; false otherwise.

sortBy

Updates the sort criterion and executes a new search.

Parameters

  • criterion: SortCriterion | SortCriterion[]

    The new sort criterion.

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

A scoped and simplified part of the headless state that is relevant to the Sort controller.

Properties

  • sortCriteria: string

    The current sort criteria.

Initialize

buildSort

Creates an insight Sort controller instance.

Parameters

  • engine: InsightEngine

    The insight engine.

  • props: SortProps

    The configurable Sort controller properties.

Returns Sort

SortProps

The configurable Sort controller properties.

Properties

  • initialState?: SortInitialState

    The initial state that should be applied to this Sort controller.

SortInitialState

The initial state that should be applied to this Sort controller.

Properties

  • criterion?: SortCriterion | SortCriterion[]

    The initial sort criterion to register in state.

Unsubscribe

Call signatures

  • (): void;