@empathyco/x-components
Version:
Empathy X Components
27 lines (15 loc) • 913 B
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
| Parameter | Type | Description |
| --- | --- | --- |
| fn | (parameters: [WireParams](./x-components.wireparams.md)<!-- --><Payload>) => void | The function to execute whenever a new value is emitted to the observable. |
**Returns:**
[Wire](./x-components.wire.md)<!-- --><Payload>
The Wire function.