UNPKG

@empathyco/x-components

Version:
27 lines (15 loc) 1 kB
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [filterFalsyPayload](./x-components.filterfalsypayload.md) ## filterFalsyPayload() function Creates a [Wire](./x-components.wire.md) that is only executed when the payload is truthy. A truthy value is whatever is not a [falsy value](https://developer.mozilla.org/en-US/docs/Glossary/Falsy)<!-- -->. **Signature:** ```typescript export declare function filterFalsyPayload<Payload>(wire: Wire<Exclude<Payload, null | undefined | false | 0 | ''>>): Wire<Payload>; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | | wire | [Wire](./x-components.wire.md)<!-- -->&lt;Exclude&lt;Payload, null \| undefined \| false \| 0 \| ''&gt;&gt; | The wire to avoid executing when the payload is falsy. | **Returns:** [Wire](./x-components.wire.md)<!-- -->&lt;Payload&gt; The Wire function falsy filter.