<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [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)<!-- -->&lt;Payload&gt; | The wire to filter. |
|  filterFn | (parameters: [WireParams](./x-components.wireparams.md)<!-- -->&lt;Payload&gt;) =&gt; 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)<!-- -->&lt;Payload&gt;

The Wire function filter.

