Sort (Insight Engine)
Sort (Insight Engine)
|
|
Note
This component was introduced in version |
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:
() => voidA 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:
stringThe current sort criteria.
Initialize
buildSort
Creates an insight Sort controller instance.
Parameters
-
engine:
InsightEngineThe insight engine.
-
props:
SortPropsThe configurable
Sortcontroller properties.
Returns Sort
SortProps
The configurable Sort controller properties.
Properties
-
initialState?:
SortInitialStateThe initial state that should be applied to this
Sortcontroller.
SortInitialState
The initial state that should be applied to this Sort controller.
Properties
-
criterion?:
SortCriterion | SortCriterion[]The initial sort criterion to register in state.
Related types
Unsubscribe
Call signatures
-
(): void;