Class: KlevuResponseObject
/ Exports / KlevuResponseObject
This class is used to access the response data from Klevu API It builds up the state of the result and it can be used to do various things with the data
• new KlevuResponseObject(response, functions)
Name | Type |
---|---|
response | |
functions |
• Private #functions: KlevuFetchFunctionReturnValue[]
• Private #queryObjects: Object = {}
▪ [id: string]: KlevuResponseQueryObject
• apiResponse: KlevuApiRawResponse
▸ Private #buildQueryObjects(): void
void
▸ queriesById(id): KlevuResponseQueryObject
Get query results by id
Name | Type | Description |
---|---|---|
id | string | query id used |
▸ queryExists(id): boolean
Check if query exists. This should be used as queriesById can throw an error
Name | Type | Description |
---|---|---|
id | string | query id used |
boolean
▸ suggestionsById(id): undefined | KlevuSuggestionResult
Get suggestions by id
Name | Type |
---|---|
id | string |
undefined | KlevuSuggestionResult