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

AsyncDebouncerState.md

132 lines2.9 KB

1---
2id: AsyncDebouncerState
3title: AsyncDebouncerState
4---
5​
6Defined in: [async-debouncer.ts:8](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L8)
7​
8## Type Parameters
9​
10### TFn
11​
12`TFn` *extends* [`AnyAsyncFunction`](../type-aliases/AnyAsyncFunction.md)
13​
14## Properties
15​
16### canLeadingExecute
17​
18```ts
19canLeadingExecute: boolean;
20```
21​
22Defined in: [async-debouncer.ts:12](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L12)
23​
24Whether the debouncer can execute on the leading edge of the timeout
25​
26***
27​
28### errorCount
29​
30```ts
31errorCount: number;
32```
33​
34Defined in: [async-debouncer.ts:16](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L16)
35​
36Number of function executions that have resulted in errors
37​
38***
39​
40### isExecuting
41​
42```ts
43isExecuting: boolean;
44```
45​
46Defined in: [async-debouncer.ts:20](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L20)
47​
48Whether the debounced function is currently executing asynchronously
49​
50***
51​
52### isPending
53​
54```ts
55isPending: boolean;
56```
57​
58Defined in: [async-debouncer.ts:24](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L24)
59​
60Whether the debouncer is waiting for the timeout to trigger execution
61​
62***
63​
64### lastArgs
65​
66```ts
67lastArgs: Parameters<TFn> | undefined;
68```
69​
70Defined in: [async-debouncer.ts:28](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L28)
71​
72The arguments from the most recent call to maybeExecute
73​
74***
75​
76### lastResult
77​
78```ts
79lastResult: Awaited<ReturnType<TFn>> | undefined;
80```
81​
82Defined in: [async-debouncer.ts:32](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L32)
83​
84The result from the most recent successful function execution
85​
86***
87​
88### maybeExecuteCount
89​
90```ts
91maybeExecuteCount: number;
92```
93​
94Defined in: [async-debouncer.ts:36](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L36)
95​
96Number of times maybeExecute has been called (for reduction calculations)
97​
98***
99​
100### settleCount
101​
102```ts
103settleCount: number;
104```
105​
106Defined in: [async-debouncer.ts:40](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L40)
107​
108Number of function executions that have completed (either successfully or with errors)
109​
110***
111​
112### status
113​
114```ts
115status: "disabled" | "idle" | "executing" | "pending" | "settled";
116```
117​
118Defined in: [async-debouncer.ts:44](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L44)
119​
120Current execution status - 'idle' when not active, 'pending' when waiting, 'executing' when running, 'settled' when completed
121​
122***
123​
124### successCount
125​
126```ts
127successCount: number;
128```
129​
130Defined in: [async-debouncer.ts:48](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L48)
131​
132Number of function executions that have completed successfully