@empathyco/x-components
Version:
Empathy X Components
71 lines (33 loc) • 1.22 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [AddQueryToHistoryAction](./x-components.addquerytohistoryaction.md) > [addQueryToHistory](./x-components.addquerytohistoryaction.addquerytohistory.md)
## AddQueryToHistoryAction.addQueryToHistory() method
Default implementation for the [HistoryQueriesActions.addQueryToHistory](./x-components.historyqueriesactions.addquerytohistory.md)<!-- -->.
**Signature:**
```typescript
addQueryToHistory({ state, dispatch }: HistoryQueriesActionContext, query: string): void | Promise<void>;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
{ state, dispatch }
</td><td>
[HistoryQueriesActionContext](./x-components.historyqueriesactioncontext.md)
</td><td>
</td></tr>
<tr><td>
query
</td><td>
string
</td><td>
The query to try to add to the history.
</td></tr>
</tbody></table>
**Returns:**
void \| Promise<void>
A `void` promise that resolves when the history queries finishes updating.