<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [AddQueryToHistoryAction](./x-components.addquerytohistoryaction.md) &gt; [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

|  Parameter | Type | Description |
|  --- | --- | --- |
|  { state, dispatch } | [HistoryQueriesActionContext](./x-components.historyqueriesactioncontext.md) |  |
|  query | string | The query to try to add to the history. |

**Returns:**

void \| Promise&lt;void&gt;

A `void` promise that resolves when the history queries finishes updating.

