<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@empathyco/x-components](./x-components.md) &gt; [debounce](./x-components.debounce.md)

## debounce() function

Creates a debounced [Wire](./x-components.wire.md)<!-- -->. Being debounced means that it will only be executed after the time given by `timeInMs` has passed without invoking it.

**Signature:**

```typescript
export declare function debounce<Payload>(wire: Wire<Payload>, timeInMs: TimeSelector | number, options?: TimedWireOperatorOptions): 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)<!-- -->&lt;Payload&gt;


</td><td>

The wire to debounce.


</td></tr>
<tr><td>

timeInMs


</td><td>

[TimeSelector](./x-components.timeselector.md) \| number


</td><td>

The time in milliseconds to debounce the wire execution or a function to retrieve it from the store.


</td></tr>
<tr><td>

options


</td><td>

[TimedWireOperatorOptions](./x-components.timedwireoperatoroptions.md)


</td><td>

_(Optional)_ Options to configure this wire with, like an event to force it or cancel it.


</td></tr>
</tbody></table>

**Returns:**

[Wire](./x-components.wire.md)<!-- -->&lt;Payload&gt;

The Wire function with a debounced timing.

