<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [createWireFromFunction](./x-components.createwirefromfunction.md)

## createWireFromFunction() function

Creates a wire that executes the function passed. This function will receive a [WireParams](./x-components.wireparams.md) object.

**Signature:**

```typescript
export declare function createWireFromFunction<Payload>(fn: (parameters: WireParams<Payload>) => void): Wire<Payload>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

fn


</td><td>

(parameters: [WireParams](./x-components.wireparams.md)<!-- -->&lt;Payload&gt;) =&gt; void


</td><td>

The function to execute whenever a new value is emitted to the observable.


</td></tr>
</tbody></table>

**Returns:**

[Wire](./x-components.wire.md)<!-- -->&lt;Payload&gt;

The Wire function.

