QueryTrigger (Commerce Engine)
QueryTrigger (Commerce Engine)
|
|
Note
This component was introduced in version |
The QueryTrigger controller handles query trigger query pipeline rules, which let you define a search query to execute when a certain condition is met.
Methods
undo
Undoes a query trigger’s correction.
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
The state of the QueryTrigger controller.
Properties
-
newQuery:
stringThe new query returned by a query trigger rule in the query pipeline.
-
originalQuery:
stringThe original query that was submitted by the user.
-
wasQueryModified:
booleanWhether the original query was modified by a trigger rule in the query pipeline.
Initialize
buildQueryTrigger
Creates a QueryTrigger controller instance.
Parameters
-
engine:
CommerceEngineThe headless commerce engine.
Returns QueryTrigger
Related types
Unsubscribe
Call signatures
-
(): void;