<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [wireCommit](./x-components.wirecommit.md)

## wireCommit() function

Creates a wire that commits a mutation to the store. This wire receives a function. This function is used to get the actual payload value passed to mutation. This wire can be used in every event, as it does not have a payload type associated.

**Signature:**

```typescript
export declare function wireCommit<Payload>(mutation: string, payloadFactory: (params: PayloadFactoryData<Payload>) => any): AnyWire;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  mutation | string | The full mutation path to commit. I.e. <code>x/searchBox/setQuery</code>. |
|  payloadFactory | (params: [PayloadFactoryData](./x-components.payloadfactorydata.md)<!-- -->&lt;Payload&gt;) =&gt; any | A function that receives a [object](./x-components.payloadfactorydata.md) with the Store state, getters, payload and metadata as parameter. |

**Returns:**

[AnyWire](./x-components.anywire.md)

A [AnyWire](./x-components.anywire.md) wire that commits the mutation with the payload returned by the payloadFactory.

