@empathyco/x-components
Version:
Empathy X Components
28 lines (16 loc) • 986 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [filter](./x-components.filter.md)
## filter() function
Creates a [Wire](./x-components.wire.md) that is only executed whenever the condition in the filterFn is true.
**Signature:**
```typescript
export declare function filter<Payload>(wire: Wire<Payload>, filterFn: (parameters: WireParams<Payload>) => boolean): Wire<Payload>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| wire | [Wire](./x-components.wire.md)<!-- --><Payload> | The wire to filter. |
| filterFn | (parameters: [WireParams](./x-components.wireparams.md)<!-- --><Payload>) => boolean | A function which must return a boolean and that will be executed every time the wire is called. |
**Returns:**
[Wire](./x-components.wire.md)<!-- --><Payload>
The Wire function filter.