@empathyco/x-components
Version:
Empathy X Components
29 lines (17 loc) • 1.24 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@empathyco/x-components](./x-components.md) > [throttle](./x-components.throttle.md)
## throttle() function
Creates a throttled [Wire](./x-components.wire.md)<!-- -->. Being throttled means that it will only be executed once every couple of milliseconds given by the `timeInMs` parameter.
**Signature:**
```typescript
export declare function throttle<Payload>(wire: Wire<Payload>, timeInMs: TimeSelector | number, options?: TimedWireOperatorOptions): Wire<Payload>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| wire | [Wire](./x-components.wire.md)<!-- --><Payload> | The wire to throttle. |
| timeInMs | [TimeSelector](./x-components.timeselector.md) \| number | The time in milliseconds to throttle the wire execution or a function to retrieve it from the store. |
| options | [TimedWireOperatorOptions](./x-components.timedwireoperatoroptions.md) | _(Optional)_ Options to configure this wire with, like an event to force it or cancel it. |
**Returns:**
[Wire](./x-components.wire.md)<!-- --><Payload>
The Wire function with a throttle timing.