UNPKG

@empathyco/x-components

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