@empathyco/x-components
Version:
Empathy X Components
57 lines (27 loc) • 1.14 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [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
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
wire
</td><td>
[Wire](./x-components.wire.md)<!-- --><Exclude<Payload, null \| undefined \| false \| 0 \| ''>>
</td><td>
The wire to avoid executing when the payload is falsy.
</td></tr>
</tbody></table>
**Returns:**
[Wire](./x-components.wire.md)<!-- --><Payload>
The Wire function falsy filter.