@empathyco/x-components
Version:
Empathy X Components
57 lines (27 loc) • 1.05 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [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)<!-- --><Payload>) => 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)<!-- --><Payload>
The Wire function.