Open History to see the last commit
1---
2id: DebounceStrategy
3title: DebounceStrategy
4---
5
6# Interface: DebounceStrategy
7
8Defined in: [packages/db/src/strategies/types.ts:42](https://github.com/TanStack/db/blob/main/packages/db/src/strategies/types.ts#L42)
9
10Debounce strategy that delays execution until activity stops
11
12## Extends
13
14- [`BaseStrategy`](BaseStrategy.md)\<`"debounce"`\>
15
16## Properties
17
18### \_type
19
20```ts
21_type: "debounce";
22```
23
24Defined in: [packages/db/src/strategies/types.ts:8](https://github.com/TanStack/db/blob/main/packages/db/src/strategies/types.ts#L8)
25
26Type discriminator for strategy identification
27
28#### Inherited from
29
30[`BaseStrategy`](BaseStrategy.md).[`_type`](BaseStrategy.md#_type)
31
32***
33
34### cleanup()
35
36```ts
37cleanup: () => void;
38```
39
40Defined in: [packages/db/src/strategies/types.ts:23](https://github.com/TanStack/db/blob/main/packages/db/src/strategies/types.ts#L23)
41
42Clean up any resources held by the strategy
43Should be called when the strategy is no longer needed
44
45#### Returns
46
47`void`
48
49#### Inherited from
50
51[`BaseStrategy`](BaseStrategy.md).[`cleanup`](BaseStrategy.md#cleanup)
52
53***
54
55### execute()
56
57```ts
58execute: <T>(fn) => void | Promise<void>;
59```
60
61Defined in: [packages/db/src/strategies/types.ts:15](https://github.com/TanStack/db/blob/main/packages/db/src/strategies/types.ts#L15)
62
63Execute a function according to the strategy's timing rules
64
65#### Type Parameters
66
67##### T
68
69`T` *extends* `object` = `Record`\<`string`, `unknown`\>
70
71#### Parameters
72
73##### fn
74
75() => [`Transaction`](Transaction.md)\<`T`\>
76
77The function to execute
78
79#### Returns
80
81`void` \| `Promise`\<`void`\>
82
83The result of the function execution (if applicable)
84
85#### Inherited from
86
87[`BaseStrategy`](BaseStrategy.md).[`execute`](BaseStrategy.md#execute)
88
89***
90
91### options
92
93```ts
94options: DebounceStrategyOptions;
95```
96
97Defined in: [packages/db/src/strategies/types.ts:43](https://github.com/TanStack/db/blob/main/packages/db/src/strategies/types.ts#L43)