Skip to content
Source
Sign inSign up
TanStack/db
Open History to see the last commit

ThrottleStrategyOptions.md

45 lines1.1 KB

1---
2id: ThrottleStrategyOptions
3title: ThrottleStrategyOptions
4---
5​
6Defined in: [packages/db/src/strategies/types.ts:78](https://github.com/TanStack/db/blob/main/packages/db/src/strategies/types.ts#L78)
7​
8Options for throttle strategy
9Ensures executions are evenly spaced over time
10​
11## Properties
12​
13### leading?
14​
15```ts
16optional leading: boolean;
17```
18​
19Defined in: [packages/db/src/strategies/types.ts:82](https://github.com/TanStack/db/blob/main/packages/db/src/strategies/types.ts#L82)
20​
21Execute immediately on the first call. Defaults to true unless trailing is explicitly true.
22​
23***
24​
25### trailing?
26​
27```ts
28optional trailing: boolean;
29```
30​
31Defined in: [packages/db/src/strategies/types.ts:84](https://github.com/TanStack/db/blob/main/packages/db/src/strategies/types.ts#L84)
32​
33Execute on the last call after wait period. Defaults to true. Disabled trailing rejects skipped optimistic calls.
34​
35***
36​
37### wait
38​
39```ts
40wait: number;
41```
42​
43Defined in: [packages/db/src/strategies/types.ts:80](https://github.com/TanStack/db/blob/main/packages/db/src/strategies/types.ts#L80)
44​
45Minimum wait time between executions (milliseconds)