@empathyco/x-components
Version:
Empathy X Components
73 lines (34 loc) • 1.14 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [wireCommit](./x-components.wirecommit_1.md)
## wireCommit() function
Creates a wire that commits a mutation to the store. This wire can receive any value as payload. This wire can be used in every event, as it does not have a payload type associated.
**Signature:**
```typescript
export declare function wireCommit(mutation: string, staticPayload: any): AnyWire;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
mutation
</td><td>
string
</td><td>
The full mutation path to commit. I.e. `x/searchBox/setQuery`<!-- -->.
</td></tr>
<tr><td>
staticPayload
</td><td>
any
</td><td>
A static payload to pass to the mutation.
</td></tr>
</tbody></table>
**Returns:**
[AnyWire](./x-components.anywire.md)
[AnyWire](./x-components.anywire.md) A wire that commits the mutation with the staticPayload payload.