@tanstack/solid-pacer 0.21.1 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/README.md +21 -6
  2. package/dist/async-batcher/createAsyncBatcher.d.ts +5 -10
  3. package/dist/async-batcher/createAsyncBatcher.js +2 -5
  4. package/dist/async-debouncer/createAsyncDebouncer.d.ts +8 -12
  5. package/dist/async-debouncer/createAsyncDebouncer.js +5 -7
  6. package/dist/async-queuer/createAsyncQueuer.d.ts +9 -12
  7. package/dist/async-queuer/createAsyncQueuer.js +4 -5
  8. package/dist/async-rate-limiter/createAsyncRateLimiter.d.ts +10 -13
  9. package/dist/async-rate-limiter/createAsyncRateLimiter.js +7 -8
  10. package/dist/async-throttler/createAsyncThrottler.d.ts +8 -14
  11. package/dist/async-throttler/createAsyncThrottler.js +5 -9
  12. package/dist/batcher/createBatcher.d.ts +11 -15
  13. package/dist/batcher/createBatcher.js +6 -8
  14. package/dist/debouncer/createDebouncedSignal.d.ts +2 -5
  15. package/dist/debouncer/createDebouncedSignal.js +1 -2
  16. package/dist/debouncer/createDebouncedValue.d.ts +2 -5
  17. package/dist/debouncer/createDebouncedValue.js +1 -2
  18. package/dist/debouncer/createDebouncer.d.ts +4 -7
  19. package/dist/debouncer/createDebouncer.js +1 -2
  20. package/dist/provider/PacerProvider.d.ts +6 -9
  21. package/dist/provider/PacerProvider.js +1 -2
  22. package/dist/queuer/createQueuedSignal.d.ts +2 -5
  23. package/dist/queuer/createQueuedSignal.js +1 -2
  24. package/dist/queuer/createQueuer.d.ts +4 -7
  25. package/dist/queuer/createQueuer.js +1 -2
  26. package/dist/rate-limiter/createRateLimitedSignal.d.ts +12 -14
  27. package/dist/rate-limiter/createRateLimitedSignal.js +11 -11
  28. package/dist/rate-limiter/createRateLimitedValue.d.ts +2 -5
  29. package/dist/rate-limiter/createRateLimitedValue.js +1 -2
  30. package/dist/rate-limiter/createRateLimiter.d.ts +8 -10
  31. package/dist/rate-limiter/createRateLimiter.js +5 -5
  32. package/dist/throttler/createThrottledSignal.d.ts +2 -7
  33. package/dist/throttler/createThrottledSignal.js +1 -4
  34. package/dist/throttler/createThrottledValue.d.ts +2 -7
  35. package/dist/throttler/createThrottledValue.js +1 -4
  36. package/dist/throttler/createThrottler.d.ts +4 -9
  37. package/dist/throttler/createThrottler.js +1 -4
  38. package/package.json +24 -68
  39. package/dist/async-batcher/createAsyncBatcher.cjs +0 -166
  40. package/dist/async-batcher/createAsyncBatcher.cjs.map +0 -1
  41. package/dist/async-batcher/createAsyncBatcher.d.cts +0 -178
  42. package/dist/async-batcher/createAsyncBatcher.js.map +0 -1
  43. package/dist/async-batcher/index.cjs +0 -11
  44. package/dist/async-batcher/index.d.cts +0 -3
  45. package/dist/async-debouncer/createAsyncDebouncer.cjs +0 -151
  46. package/dist/async-debouncer/createAsyncDebouncer.cjs.map +0 -1
  47. package/dist/async-debouncer/createAsyncDebouncer.d.cts +0 -164
  48. package/dist/async-debouncer/createAsyncDebouncer.js.map +0 -1
  49. package/dist/async-debouncer/index.cjs +0 -11
  50. package/dist/async-debouncer/index.d.cts +0 -3
  51. package/dist/async-queuer/createAsyncQueuer.cjs +0 -158
  52. package/dist/async-queuer/createAsyncQueuer.cjs.map +0 -1
  53. package/dist/async-queuer/createAsyncQueuer.d.cts +0 -170
  54. package/dist/async-queuer/createAsyncQueuer.js.map +0 -1
  55. package/dist/async-queuer/index.cjs +0 -11
  56. package/dist/async-queuer/index.d.cts +0 -3
  57. package/dist/async-rate-limiter/createAsyncRateLimiter.cjs +0 -193
  58. package/dist/async-rate-limiter/createAsyncRateLimiter.cjs.map +0 -1
  59. package/dist/async-rate-limiter/createAsyncRateLimiter.d.cts +0 -209
  60. package/dist/async-rate-limiter/createAsyncRateLimiter.js.map +0 -1
  61. package/dist/async-rate-limiter/index.cjs +0 -11
  62. package/dist/async-rate-limiter/index.d.cts +0 -3
  63. package/dist/async-throttler/createAsyncThrottler.cjs +0 -151
  64. package/dist/async-throttler/createAsyncThrottler.cjs.map +0 -1
  65. package/dist/async-throttler/createAsyncThrottler.d.cts +0 -164
  66. package/dist/async-throttler/createAsyncThrottler.js.map +0 -1
  67. package/dist/async-throttler/index.cjs +0 -11
  68. package/dist/async-throttler/index.d.cts +0 -3
  69. package/dist/batcher/createBatcher.cjs +0 -132
  70. package/dist/batcher/createBatcher.cjs.map +0 -1
  71. package/dist/batcher/createBatcher.d.cts +0 -147
  72. package/dist/batcher/createBatcher.js.map +0 -1
  73. package/dist/batcher/index.cjs +0 -11
  74. package/dist/batcher/index.d.cts +0 -3
  75. package/dist/debouncer/createDebouncedSignal.cjs +0 -88
  76. package/dist/debouncer/createDebouncedSignal.cjs.map +0 -1
  77. package/dist/debouncer/createDebouncedSignal.d.cts +0 -80
  78. package/dist/debouncer/createDebouncedSignal.js.map +0 -1
  79. package/dist/debouncer/createDebouncedValue.cjs +0 -77
  80. package/dist/debouncer/createDebouncedValue.cjs.map +0 -1
  81. package/dist/debouncer/createDebouncedValue.d.cts +0 -71
  82. package/dist/debouncer/createDebouncedValue.js.map +0 -1
  83. package/dist/debouncer/createDebouncer.cjs +0 -129
  84. package/dist/debouncer/createDebouncer.cjs.map +0 -1
  85. package/dist/debouncer/createDebouncer.d.cts +0 -145
  86. package/dist/debouncer/createDebouncer.js.map +0 -1
  87. package/dist/debouncer/index.cjs +0 -15
  88. package/dist/debouncer/index.d.cts +0 -5
  89. package/dist/index.cjs +0 -47
  90. package/dist/index.d.cts +0 -20
  91. package/dist/provider/PacerProvider.cjs +0 -27
  92. package/dist/provider/PacerProvider.cjs.map +0 -1
  93. package/dist/provider/PacerProvider.d.cts +0 -29
  94. package/dist/provider/PacerProvider.js.map +0 -1
  95. package/dist/provider/index.cjs +0 -6
  96. package/dist/provider/index.d.cts +0 -2
  97. package/dist/queuer/createQueuedSignal.cjs +0 -129
  98. package/dist/queuer/createQueuedSignal.cjs.map +0 -1
  99. package/dist/queuer/createQueuedSignal.d.cts +0 -122
  100. package/dist/queuer/createQueuedSignal.js.map +0 -1
  101. package/dist/queuer/createQueuer.cjs +0 -133
  102. package/dist/queuer/createQueuer.cjs.map +0 -1
  103. package/dist/queuer/createQueuer.d.cts +0 -148
  104. package/dist/queuer/createQueuer.js.map +0 -1
  105. package/dist/queuer/index.cjs +0 -13
  106. package/dist/queuer/index.d.cts +0 -4
  107. package/dist/rate-limiter/createRateLimitedSignal.cjs +0 -102
  108. package/dist/rate-limiter/createRateLimitedSignal.cjs.map +0 -1
  109. package/dist/rate-limiter/createRateLimitedSignal.d.cts +0 -94
  110. package/dist/rate-limiter/createRateLimitedSignal.js.map +0 -1
  111. package/dist/rate-limiter/createRateLimitedValue.cjs +0 -102
  112. package/dist/rate-limiter/createRateLimitedValue.cjs.map +0 -1
  113. package/dist/rate-limiter/createRateLimitedValue.d.cts +0 -96
  114. package/dist/rate-limiter/createRateLimitedValue.js.map +0 -1
  115. package/dist/rate-limiter/createRateLimiter.cjs +0 -157
  116. package/dist/rate-limiter/createRateLimiter.cjs.map +0 -1
  117. package/dist/rate-limiter/createRateLimiter.d.cts +0 -174
  118. package/dist/rate-limiter/createRateLimiter.js.map +0 -1
  119. package/dist/rate-limiter/index.cjs +0 -15
  120. package/dist/rate-limiter/index.d.cts +0 -5
  121. package/dist/throttler/createThrottledSignal.cjs +0 -79
  122. package/dist/throttler/createThrottledSignal.cjs.map +0 -1
  123. package/dist/throttler/createThrottledSignal.d.cts +0 -71
  124. package/dist/throttler/createThrottledSignal.js.map +0 -1
  125. package/dist/throttler/createThrottledValue.cjs +0 -74
  126. package/dist/throttler/createThrottledValue.cjs.map +0 -1
  127. package/dist/throttler/createThrottledValue.d.cts +0 -68
  128. package/dist/throttler/createThrottledValue.js.map +0 -1
  129. package/dist/throttler/createThrottler.cjs +0 -132
  130. package/dist/throttler/createThrottler.cjs.map +0 -1
  131. package/dist/throttler/createThrottler.d.cts +0 -148
  132. package/dist/throttler/createThrottler.js.map +0 -1
  133. package/dist/throttler/index.cjs +0 -15
  134. package/dist/throttler/index.d.cts +0 -5
  135. package/dist/types/index.cjs +0 -9
  136. package/dist/types/index.d.cts +0 -1
  137. package/dist/utils/index.cjs +0 -9
  138. package/dist/utils/index.d.cts +0 -1
  139. package/src/async-batcher/createAsyncBatcher.ts +0 -234
  140. package/src/async-batcher/index.ts +0 -3
  141. package/src/async-debouncer/createAsyncDebouncer.ts +0 -225
  142. package/src/async-debouncer/index.ts +0 -4
  143. package/src/async-queuer/createAsyncQueuer.ts +0 -226
  144. package/src/async-queuer/index.ts +0 -3
  145. package/src/async-rate-limiter/createAsyncRateLimiter.ts +0 -269
  146. package/src/async-rate-limiter/index.ts +0 -4
  147. package/src/async-throttler/createAsyncThrottler.ts +0 -225
  148. package/src/async-throttler/index.ts +0 -4
  149. package/src/batcher/createBatcher.ts +0 -199
  150. package/src/batcher/index.ts +0 -3
  151. package/src/debouncer/createDebouncedSignal.ts +0 -92
  152. package/src/debouncer/createDebouncedValue.ts +0 -85
  153. package/src/debouncer/createDebouncer.ts +0 -201
  154. package/src/debouncer/index.ts +0 -6
  155. package/src/index.ts +0 -46
  156. package/src/provider/PacerProvider.tsx +0 -63
  157. package/src/provider/index.ts +0 -1
  158. package/src/queuer/createQueuedSignal.ts +0 -138
  159. package/src/queuer/createQueuer.ts +0 -199
  160. package/src/queuer/index.ts +0 -4
  161. package/src/rate-limiter/createRateLimitedSignal.ts +0 -117
  162. package/src/rate-limiter/createRateLimitedValue.ts +0 -110
  163. package/src/rate-limiter/createRateLimiter.ts +0 -226
  164. package/src/rate-limiter/index.ts +0 -5
  165. package/src/throttler/createThrottledSignal.ts +0 -81
  166. package/src/throttler/createThrottledValue.ts +0 -82
  167. package/src/throttler/createThrottler.ts +0 -204
  168. package/src/throttler/index.ts +0 -6
  169. package/src/types/index.ts +0 -1
  170. package/src/utils/index.ts +0 -1
package/README.md CHANGED
@@ -1,5 +1,19 @@
1
1
  <div align="center">
2
- <img src="./media/header_pacer.png" >
2
+ <picture>
3
+ <source
4
+ media="(prefers-color-scheme: dark)"
5
+ srcset="https://tanstack.com/api/readme/pacer.png?theme=dark"
6
+ />
7
+ <source
8
+ media="(prefers-color-scheme: light)"
9
+ srcset="https://tanstack.com/api/readme/pacer.png"
10
+ />
11
+ <img
12
+ src="https://tanstack.com/api/readme/pacer.png"
13
+ alt="TanStack Pacer"
14
+ width="900"
15
+ />
16
+ </picture>
3
17
  </div>
4
18
 
5
19
  <br />
@@ -29,8 +43,9 @@
29
43
  </div>
30
44
 
31
45
  <div align="center">
32
-
46
+
33
47
  ### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)
48
+
34
49
  </div>
35
50
 
36
51
  # TanStack Pacer
@@ -88,10 +103,10 @@ A lightweight timing and scheduling library for debouncing, throttling, rate lim
88
103
  > [!NOTE]
89
104
  > You may know **TanStack Pacer** by our adapter names, too!
90
105
  >
91
- > - [**React Pacer**](https://tanstack.com/pacer/latest/docs/framework/react/react-pacer)
92
- > - [**Preact Pacer**](https://tanstack.com/pacer/latest/docs/framework/preact/preact-pacer)
93
- > - [**Solid Pacer**](https://tanstack.com/pacer/latest/docs/framework/solid/solid-pacer)
94
- > - [**Angular Pacer**](https://tanstack.com/pacer/latest/docs/framework/angular/angular-pacer)
106
+ > - [**React Pacer**](https://tanstack.com/pacer/latest/docs/framework/react)
107
+ > - [**Preact Pacer**](https://tanstack.com/pacer/latest/docs/framework/preact)
108
+ > - [**Solid Pacer**](https://tanstack.com/pacer/latest/docs/framework/solid)
109
+ > - [**Angular Pacer**](https://tanstack.com/pacer/latest/docs/framework/angular)
95
110
  > - Svelte Pacer - needs a contributor!
96
111
  > - Vue Pacer - needs a contributor!
97
112
 
@@ -1,16 +1,15 @@
1
1
  import { Accessor, JSX } from "solid-js";
2
2
  import { AsyncBatcher, AsyncBatcherOptions, AsyncBatcherState } from "@tanstack/pacer/async-batcher";
3
3
  import { Store } from "@tanstack/solid-store";
4
-
5
4
  //#region src/async-batcher/createAsyncBatcher.d.ts
6
- interface SolidAsyncBatcherOptions<TValue, TSelected = {}> extends AsyncBatcherOptions<TValue> {
5
+ export interface SolidAsyncBatcherOptions<TValue, TSelected = {}> extends AsyncBatcherOptions<TValue> {
7
6
  /**
8
7
  * Optional callback invoked when the owning component unmounts. Receives the batcher instance.
9
8
  * When provided, replaces the default cleanup (cancel + abort); use it to call flush(), reset(), cancel(), add logging, etc.
10
9
  */
11
10
  onUnmount?: (batcher: SolidAsyncBatcher<TValue, TSelected>) => void;
12
11
  }
13
- interface SolidAsyncBatcher<TValue, TSelected = {}> extends Omit<AsyncBatcher<TValue>, 'store'> {
12
+ export interface SolidAsyncBatcher<TValue, TSelected = {}> extends Omit<AsyncBatcher<TValue>, 'store'> {
14
13
  /**
15
14
  * A Solid component that allows you to subscribe to the batcher state.
16
15
  *
@@ -95,10 +94,8 @@ interface SolidAsyncBatcher<TValue, TSelected = {}> extends Omit<AsyncBatcher<TV
95
94
  * Available state properties:
96
95
  * - `errorCount`: Number of failed batch executions
97
96
  * - `executionCount`: Total number of batch execution attempts (successful + failed)
98
- * - `hasError`: Whether the last batch execution resulted in an error
99
97
  * - `isExecuting`: Whether a batch execution is currently in progress
100
98
  * - `items`: Array of items currently queued for batching
101
- * - `lastError`: The error from the most recent failed batch execution (if any)
102
99
  * - `lastResult`: The result from the most recent successful batch execution
103
100
  * - `settleCount`: Number of batch executions that have completed (successful or failed)
104
101
  * - `successCount`: Number of successful batch executions
@@ -159,7 +156,7 @@ interface SolidAsyncBatcher<TValue, TSelected = {}> extends Omit<AsyncBatcher<TV
159
156
  * return results;
160
157
  * },
161
158
  * { maxSize: 10, wait: 2000 },
162
- * (state) => ({ hasError: state.hasError, lastError: state.lastError })
159
+ * (state) => ({ errorCount: state.errorCount })
163
160
  * );
164
161
  *
165
162
  * // Add items to batch
@@ -172,7 +169,5 @@ interface SolidAsyncBatcher<TValue, TSelected = {}> extends Omit<AsyncBatcher<TV
172
169
  * const { items, isExecuting } = asyncBatcher.state();
173
170
  * ```
174
171
  */
175
- declare function createAsyncBatcher<TValue, TSelected = {}>(fn: (items: Array<TValue>) => Promise<any>, options?: SolidAsyncBatcherOptions<TValue, TSelected>, selector?: (state: AsyncBatcherState<TValue>) => TSelected): SolidAsyncBatcher<TValue, TSelected>;
176
- //#endregion
177
- export { SolidAsyncBatcher, SolidAsyncBatcherOptions, createAsyncBatcher };
178
- //# sourceMappingURL=createAsyncBatcher.d.ts.map
172
+ export declare function createAsyncBatcher<TValue, TSelected = {}>(fn: (items: Array<TValue>) => Promise<any>, options?: SolidAsyncBatcherOptions<TValue, TSelected>, selector?: (state: AsyncBatcherState<TValue>) => TSelected): SolidAsyncBatcher<TValue, TSelected>;
173
+ //#endregion
@@ -58,10 +58,8 @@ import { shallow, useSelector } from "@tanstack/solid-store";
58
58
  * Available state properties:
59
59
  * - `errorCount`: Number of failed batch executions
60
60
  * - `executionCount`: Total number of batch execution attempts (successful + failed)
61
- * - `hasError`: Whether the last batch execution resulted in an error
62
61
  * - `isExecuting`: Whether a batch execution is currently in progress
63
62
  * - `items`: Array of items currently queued for batching
64
- * - `lastError`: The error from the most recent failed batch execution (if any)
65
63
  * - `lastResult`: The result from the most recent successful batch execution
66
64
  * - `settleCount`: Number of batch executions that have completed (successful or failed)
67
65
  * - `successCount`: Number of successful batch executions
@@ -122,7 +120,7 @@ import { shallow, useSelector } from "@tanstack/solid-store";
122
120
  * return results;
123
121
  * },
124
122
  * { maxSize: 10, wait: 2000 },
125
- * (state) => ({ hasError: state.hasError, lastError: state.lastError })
123
+ * (state) => ({ errorCount: state.errorCount })
126
124
  * );
127
125
  *
128
126
  * // Add items to batch
@@ -162,5 +160,4 @@ function createAsyncBatcher(fn, options = {}, selector = () => ({})) {
162
160
  }
163
161
 
164
162
  //#endregion
165
- export { createAsyncBatcher };
166
- //# sourceMappingURL=createAsyncBatcher.js.map
163
+ export { createAsyncBatcher };
@@ -2,16 +2,15 @@ import { Accessor, JSX } from "solid-js";
2
2
  import { Store } from "@tanstack/solid-store";
3
3
  import { AsyncDebouncer, AsyncDebouncerOptions, AsyncDebouncerState } from "@tanstack/pacer/async-debouncer";
4
4
  import { AnyAsyncFunction } from "@tanstack/pacer/types";
5
-
6
5
  //#region src/async-debouncer/createAsyncDebouncer.d.ts
7
- interface SolidAsyncDebouncerOptions<TFn extends AnyAsyncFunction, TSelected = {}> extends AsyncDebouncerOptions<TFn> {
6
+ export interface SolidAsyncDebouncerOptions<TFn extends AnyAsyncFunction, TSelected = {}> extends AsyncDebouncerOptions<TFn> {
8
7
  /**
9
8
  * Optional callback invoked when the owning component unmounts. Receives the debouncer instance.
10
9
  * When provided, replaces the default cleanup (cancel + abort); use it to call flush(), reset(), cancel(), add logging, etc.
11
10
  */
12
11
  onUnmount?: (debouncer: SolidAsyncDebouncer<TFn, TSelected>) => void;
13
12
  }
14
- interface SolidAsyncDebouncer<TFn extends AnyAsyncFunction, TSelected = {}> extends Omit<AsyncDebouncer<TFn>, 'store'> {
13
+ export interface SolidAsyncDebouncer<TFn extends AnyAsyncFunction, TSelected = {}> extends Omit<AsyncDebouncer<TFn>, 'store'> {
15
14
  /**
16
15
  * A Solid component that allows you to subscribe to the debouncer state.
17
16
  *
@@ -89,14 +88,13 @@ interface SolidAsyncDebouncer<TFn extends AnyAsyncFunction, TSelected = {}> exte
89
88
  *
90
89
  * Available state properties:
91
90
  * - `canLeadingExecute`: Whether the debouncer can execute on the leading edge
92
- * - `executionCount`: Number of function executions that have been completed
93
- * - `hasError`: Whether the last execution resulted in an error
91
+ * - `settleCount`: Number of function executions that have completed (success or error)
92
+ * - `errorCount`: Number of function executions that have resulted in errors
94
93
  * - `isPending`: Whether the debouncer is waiting for the timeout to trigger execution
95
94
  * - `isExecuting`: Whether an async function execution is currently in progress
96
95
  * - `lastArgs`: The arguments from the most recent call to maybeExecute
97
- * - `lastError`: The error from the most recent failed execution (if any)
98
96
  * - `lastResult`: The result from the most recent successful execution
99
- * - `status`: Current execution status ('disabled' | 'idle' | 'pending' | 'executing')
97
+ * - `status`: Current execution status ('disabled' | 'idle' | 'pending' | 'executing' | 'settled')
100
98
  *
101
99
  * ## Unmount behavior
102
100
  *
@@ -151,14 +149,12 @@ interface SolidAsyncDebouncer<TFn extends AnyAsyncFunction, TSelected = {}> exte
151
149
  * console.error('API call failed:', error);
152
150
  * }
153
151
  * },
154
- * (state) => ({ hasError: state.hasError, lastError: state.lastError })
152
+ * (state) => ({ errorCount: state.errorCount })
155
153
  * );
156
154
  *
157
155
  * // Access the selected state (will be empty object {} unless selector provided)
158
156
  * const { isPending, isExecuting } = debouncer.state();
159
157
  * ```
160
158
  */
161
- declare function createAsyncDebouncer<TFn extends AnyAsyncFunction, TSelected = {}>(fn: TFn, options: SolidAsyncDebouncerOptions<TFn, TSelected>, selector?: (state: AsyncDebouncerState<TFn>) => TSelected): SolidAsyncDebouncer<TFn, TSelected>;
162
- //#endregion
163
- export { SolidAsyncDebouncer, SolidAsyncDebouncerOptions, createAsyncDebouncer };
164
- //# sourceMappingURL=createAsyncDebouncer.d.ts.map
159
+ export declare function createAsyncDebouncer<TFn extends AnyAsyncFunction, TSelected = {}>(fn: TFn, options: SolidAsyncDebouncerOptions<TFn, TSelected>, selector?: (state: AsyncDebouncerState<TFn>) => TSelected): SolidAsyncDebouncer<TFn, TSelected>;
160
+ //#endregion
@@ -51,14 +51,13 @@ import { AsyncDebouncer } from "@tanstack/pacer/async-debouncer";
51
51
  *
52
52
  * Available state properties:
53
53
  * - `canLeadingExecute`: Whether the debouncer can execute on the leading edge
54
- * - `executionCount`: Number of function executions that have been completed
55
- * - `hasError`: Whether the last execution resulted in an error
54
+ * - `settleCount`: Number of function executions that have completed (success or error)
55
+ * - `errorCount`: Number of function executions that have resulted in errors
56
56
  * - `isPending`: Whether the debouncer is waiting for the timeout to trigger execution
57
57
  * - `isExecuting`: Whether an async function execution is currently in progress
58
58
  * - `lastArgs`: The arguments from the most recent call to maybeExecute
59
- * - `lastError`: The error from the most recent failed execution (if any)
60
59
  * - `lastResult`: The result from the most recent successful execution
61
- * - `status`: Current execution status ('disabled' | 'idle' | 'pending' | 'executing')
60
+ * - `status`: Current execution status ('disabled' | 'idle' | 'pending' | 'executing' | 'settled')
62
61
  *
63
62
  * ## Unmount behavior
64
63
  *
@@ -113,7 +112,7 @@ import { AsyncDebouncer } from "@tanstack/pacer/async-debouncer";
113
112
  * console.error('API call failed:', error);
114
113
  * }
115
114
  * },
116
- * (state) => ({ hasError: state.hasError, lastError: state.lastError })
115
+ * (state) => ({ errorCount: state.errorCount })
117
116
  * );
118
117
  *
119
118
  * // Access the selected state (will be empty object {} unless selector provided)
@@ -147,5 +146,4 @@ function createAsyncDebouncer(fn, options, selector = () => ({})) {
147
146
  }
148
147
 
149
148
  //#endregion
150
- export { createAsyncDebouncer };
151
- //# sourceMappingURL=createAsyncDebouncer.js.map
149
+ export { createAsyncDebouncer };
@@ -1,16 +1,15 @@
1
1
  import { Accessor, JSX } from "solid-js";
2
2
  import { Store } from "@tanstack/solid-store";
3
3
  import { AsyncQueuer, AsyncQueuerOptions, AsyncQueuerState } from "@tanstack/pacer/async-queuer";
4
-
5
4
  //#region src/async-queuer/createAsyncQueuer.d.ts
6
- interface SolidAsyncQueuerOptions<TValue, TSelected = {}> extends AsyncQueuerOptions<TValue> {
5
+ export interface SolidAsyncQueuerOptions<TValue, TSelected = {}> extends AsyncQueuerOptions<TValue> {
7
6
  /**
8
7
  * Optional callback invoked when the owning component unmounts. Receives the queuer instance.
9
8
  * When provided, replaces the default cleanup (stop + abort); use it to call flush(), flushAsBatch(), stop(), add logging, etc.
10
9
  */
11
10
  onUnmount?: (queuer: SolidAsyncQueuer<TValue, TSelected>) => void;
12
11
  }
13
- interface SolidAsyncQueuer<TValue, TSelected = {}> extends Omit<AsyncQueuer<TValue>, 'store'> {
12
+ export interface SolidAsyncQueuer<TValue, TSelected = {}> extends Omit<AsyncQueuer<TValue>, 'store'> {
14
13
  /**
15
14
  * A Solid component that allows you to subscribe to the queuer state.
16
15
  *
@@ -18,9 +17,9 @@ interface SolidAsyncQueuer<TValue, TSelected = {}> extends Omit<AsyncQueuer<TVal
18
17
  * deep in your component tree without needing to pass a selector to the hook.
19
18
  *
20
19
  * @example
21
- * <queuer.Subscribe selector={(state) => ({ pendingItems: state.pendingItems, activeItems: state.activeItems })}>
20
+ * <queuer.Subscribe selector={(state) => ({ items: state.items, activeItems: state.activeItems })}>
22
21
  * {(state) => (
23
- * <div>Pending: {state().pendingItems.length}, Active: {state().activeItems.length}</div>
22
+ * <div>Pending: {state().items.length}, Active: {state().activeItems.length}</div>
24
23
  * )}
25
24
  * </queuer.Subscribe>
26
25
  */
@@ -89,7 +88,7 @@ interface SolidAsyncQueuer<TValue, TSelected = {}> extends Omit<AsyncQueuer<TVal
89
88
  * - `activeItems`: Array of items currently being processed
90
89
  * - `errorCount`: Number of items that failed processing
91
90
  * - `isRunning`: Whether the queuer is currently running (not stopped)
92
- * - `pendingItems`: Array of items waiting to be processed
91
+ * - `items`: Array of items waiting to be processed
93
92
  * - `rejectionCount`: Number of items that were rejected (expired or failed validation)
94
93
  * - `settleCount`: Number of items that have completed processing (successful or failed)
95
94
  * - `successCount`: Number of items that were processed successfully
@@ -137,7 +136,7 @@ interface SolidAsyncQueuer<TValue, TSelected = {}> extends Omit<AsyncQueuer<TVal
137
136
  * async (item) => await fetchData(item),
138
137
  * { concurrency: 2, started: true },
139
138
  * (state) => ({
140
- * pendingItems: state.pendingItems,
139
+ * items: state.items,
141
140
  * activeItems: state.activeItems,
142
141
  * isRunning: state.isRunning
143
142
  * })
@@ -161,10 +160,8 @@ interface SolidAsyncQueuer<TValue, TSelected = {}> extends Omit<AsyncQueuer<TVal
161
160
  * asyncQueuer.start();
162
161
  *
163
162
  * // Access the selected state (will be empty object {} unless selector provided)
164
- * const { pendingItems, activeItems } = asyncQueuer.state();
163
+ * const { items, activeItems } = asyncQueuer.state();
165
164
  * ```
166
165
  */
167
- declare function createAsyncQueuer<TValue, TSelected = {}>(fn: (value: TValue) => Promise<any>, options?: SolidAsyncQueuerOptions<TValue, TSelected>, selector?: (state: AsyncQueuerState<TValue>) => TSelected): SolidAsyncQueuer<TValue, TSelected>;
168
- //#endregion
169
- export { SolidAsyncQueuer, SolidAsyncQueuerOptions, createAsyncQueuer };
170
- //# sourceMappingURL=createAsyncQueuer.d.ts.map
166
+ export declare function createAsyncQueuer<TValue, TSelected = {}>(fn: (value: TValue) => Promise<any>, options?: SolidAsyncQueuerOptions<TValue, TSelected>, selector?: (state: AsyncQueuerState<TValue>) => TSelected): SolidAsyncQueuer<TValue, TSelected>;
167
+ //#endregion
@@ -52,7 +52,7 @@ import { AsyncQueuer } from "@tanstack/pacer/async-queuer";
52
52
  * - `activeItems`: Array of items currently being processed
53
53
  * - `errorCount`: Number of items that failed processing
54
54
  * - `isRunning`: Whether the queuer is currently running (not stopped)
55
- * - `pendingItems`: Array of items waiting to be processed
55
+ * - `items`: Array of items waiting to be processed
56
56
  * - `rejectionCount`: Number of items that were rejected (expired or failed validation)
57
57
  * - `settleCount`: Number of items that have completed processing (successful or failed)
58
58
  * - `successCount`: Number of items that were processed successfully
@@ -100,7 +100,7 @@ import { AsyncQueuer } from "@tanstack/pacer/async-queuer";
100
100
  * async (item) => await fetchData(item),
101
101
  * { concurrency: 2, started: true },
102
102
  * (state) => ({
103
- * pendingItems: state.pendingItems,
103
+ * items: state.items,
104
104
  * activeItems: state.activeItems,
105
105
  * isRunning: state.isRunning
106
106
  * })
@@ -124,7 +124,7 @@ import { AsyncQueuer } from "@tanstack/pacer/async-queuer";
124
124
  * asyncQueuer.start();
125
125
  *
126
126
  * // Access the selected state (will be empty object {} unless selector provided)
127
- * const { pendingItems, activeItems } = asyncQueuer.state();
127
+ * const { items, activeItems } = asyncQueuer.state();
128
128
  * ```
129
129
  */
130
130
  function createAsyncQueuer(fn, options = {}, selector = () => ({})) {
@@ -154,5 +154,4 @@ function createAsyncQueuer(fn, options = {}, selector = () => ({})) {
154
154
  }
155
155
 
156
156
  //#endregion
157
- export { createAsyncQueuer };
158
- //# sourceMappingURL=createAsyncQueuer.js.map
157
+ export { createAsyncQueuer };
@@ -2,16 +2,15 @@ import { Accessor, JSX } from "solid-js";
2
2
  import { Store } from "@tanstack/solid-store";
3
3
  import { AsyncRateLimiter, AsyncRateLimiterOptions, AsyncRateLimiterState } from "@tanstack/pacer/async-rate-limiter";
4
4
  import { AnyAsyncFunction } from "@tanstack/pacer/types";
5
-
6
5
  //#region src/async-rate-limiter/createAsyncRateLimiter.d.ts
7
- interface SolidAsyncRateLimiterOptions<TFn extends AnyAsyncFunction, TSelected = {}> extends AsyncRateLimiterOptions<TFn> {
6
+ export interface SolidAsyncRateLimiterOptions<TFn extends AnyAsyncFunction, TSelected = {}> extends AsyncRateLimiterOptions<TFn> {
8
7
  /**
9
8
  * Optional callback invoked when the owning component unmounts. Receives the rate limiter instance.
10
9
  * When provided, replaces the default cleanup (abort); use it to call reset(), add logging, etc.
11
10
  */
12
11
  onUnmount?: (rateLimiter: SolidAsyncRateLimiter<TFn, TSelected>) => void;
13
12
  }
14
- interface SolidAsyncRateLimiter<TFn extends AnyAsyncFunction, TSelected = {}> extends Omit<AsyncRateLimiter<TFn>, 'store'> {
13
+ export interface SolidAsyncRateLimiter<TFn extends AnyAsyncFunction, TSelected = {}> extends Omit<AsyncRateLimiter<TFn>, 'store'> {
15
14
  /**
16
15
  * A Solid component that allows you to subscribe to the rate limiter state.
17
16
  *
@@ -98,16 +97,16 @@ interface SolidAsyncRateLimiter<TFn extends AnyAsyncFunction, TSelected = {}> ex
98
97
  * tracking by providing a selector function or using the `Subscribe` component. This prevents unnecessary
99
98
  * updates and gives you full control over when your component tracks state changes.
100
99
  *
100
+ * Use `getRemainingInWindow()` and `getMsUntilNextWindow()` for current window capacity and timing.
101
+ *
101
102
  * Available state properties:
102
- * - `currentWindowStart`: Timestamp when the current window started
103
- * - `executionCount`: Number of function executions that have been completed
104
- * - `hasError`: Whether the last execution resulted in an error
103
+ * - `executionTimes`: Timestamps of executions tracked for the current window
104
+ * - `isExceeded`: Whether the rate limit has been reached
105
+ * - `settleCount`: Number of function executions that have completed (success or error)
106
+ * - `errorCount`: Number of function executions that have resulted in errors
105
107
  * - `isExecuting`: Whether an async function execution is currently in progress
106
- * - `lastError`: The error from the most recent failed execution (if any)
107
108
  * - `lastResult`: The result from the most recent successful execution
108
- * - `nextWindowTime`: Timestamp when the next window begins
109
109
  * - `rejectionCount`: Number of function calls that were rejected due to rate limiting
110
- * - `remainingInWindow`: Number of executions remaining in the current window
111
110
  *
112
111
  * ## Unmount behavior
113
112
  *
@@ -203,7 +202,5 @@ interface SolidAsyncRateLimiter<TFn extends AnyAsyncFunction, TSelected = {}> ex
203
202
  * const { isExecuting, lastResult, rejectionCount } = asyncRateLimiter.state();
204
203
  * ```
205
204
  */
206
- declare function createAsyncRateLimiter<TFn extends AnyAsyncFunction, TSelected = {}>(fn: TFn, options: SolidAsyncRateLimiterOptions<TFn, TSelected>, selector?: (state: AsyncRateLimiterState<TFn>) => TSelected): SolidAsyncRateLimiter<TFn, TSelected>;
207
- //#endregion
208
- export { SolidAsyncRateLimiter, SolidAsyncRateLimiterOptions, createAsyncRateLimiter };
209
- //# sourceMappingURL=createAsyncRateLimiter.d.ts.map
205
+ export declare function createAsyncRateLimiter<TFn extends AnyAsyncFunction, TSelected = {}>(fn: TFn, options: SolidAsyncRateLimiterOptions<TFn, TSelected>, selector?: (state: AsyncRateLimiterState<TFn>) => TSelected): SolidAsyncRateLimiter<TFn, TSelected>;
206
+ //#endregion
@@ -60,16 +60,16 @@ import { AsyncRateLimiter } from "@tanstack/pacer/async-rate-limiter";
60
60
  * tracking by providing a selector function or using the `Subscribe` component. This prevents unnecessary
61
61
  * updates and gives you full control over when your component tracks state changes.
62
62
  *
63
+ * Use `getRemainingInWindow()` and `getMsUntilNextWindow()` for current window capacity and timing.
64
+ *
63
65
  * Available state properties:
64
- * - `currentWindowStart`: Timestamp when the current window started
65
- * - `executionCount`: Number of function executions that have been completed
66
- * - `hasError`: Whether the last execution resulted in an error
66
+ * - `executionTimes`: Timestamps of executions tracked for the current window
67
+ * - `isExceeded`: Whether the rate limit has been reached
68
+ * - `settleCount`: Number of function executions that have completed (success or error)
69
+ * - `errorCount`: Number of function executions that have resulted in errors
67
70
  * - `isExecuting`: Whether an async function execution is currently in progress
68
- * - `lastError`: The error from the most recent failed execution (if any)
69
71
  * - `lastResult`: The result from the most recent successful execution
70
- * - `nextWindowTime`: Timestamp when the next window begins
71
72
  * - `rejectionCount`: Number of function calls that were rejected due to rate limiting
72
- * - `remainingInWindow`: Number of executions remaining in the current window
73
73
  *
74
74
  * ## Unmount behavior
75
75
  *
@@ -189,5 +189,4 @@ function createAsyncRateLimiter(fn, options, selector = () => ({})) {
189
189
  }
190
190
 
191
191
  //#endregion
192
- export { createAsyncRateLimiter };
193
- //# sourceMappingURL=createAsyncRateLimiter.js.map
192
+ export { createAsyncRateLimiter };
@@ -2,16 +2,15 @@ import { Accessor, JSX } from "solid-js";
2
2
  import { Store } from "@tanstack/solid-store";
3
3
  import { AsyncThrottler, AsyncThrottlerOptions, AsyncThrottlerState } from "@tanstack/pacer/async-throttler";
4
4
  import { AnyAsyncFunction } from "@tanstack/pacer/types";
5
-
6
5
  //#region src/async-throttler/createAsyncThrottler.d.ts
7
- interface SolidAsyncThrottlerOptions<TFn extends AnyAsyncFunction, TSelected = {}> extends AsyncThrottlerOptions<TFn> {
6
+ export interface SolidAsyncThrottlerOptions<TFn extends AnyAsyncFunction, TSelected = {}> extends AsyncThrottlerOptions<TFn> {
8
7
  /**
9
8
  * Optional callback invoked when the owning component unmounts. Receives the throttler instance.
10
9
  * When provided, replaces the default cleanup (cancel + abort); use it to call flush(), reset(), cancel(), add logging, etc.
11
10
  */
12
11
  onUnmount?: (throttler: SolidAsyncThrottler<TFn, TSelected>) => void;
13
12
  }
14
- interface SolidAsyncThrottler<TFn extends AnyAsyncFunction, TSelected = {}> extends Omit<AsyncThrottler<TFn>, 'store'> {
13
+ export interface SolidAsyncThrottler<TFn extends AnyAsyncFunction, TSelected = {}> extends Omit<AsyncThrottler<TFn>, 'store'> {
15
14
  /**
16
15
  * A Solid component that allows you to subscribe to the throttler state.
17
16
  *
@@ -85,18 +84,15 @@ interface SolidAsyncThrottler<TFn extends AnyAsyncFunction, TSelected = {}> exte
85
84
  * updates and gives you full control over when your component tracks state changes.
86
85
  *
87
86
  * Available state properties:
88
- * - `canLeadingExecute`: Whether the throttler can execute on the leading edge
89
- * - `canTrailingExecute`: Whether the throttler can execute on the trailing edge
90
- * - `executionCount`: Number of function executions that have been completed
91
- * - `hasError`: Whether the last execution resulted in an error
87
+ * - `settleCount`: Number of function executions that have completed (success or error)
88
+ * - `errorCount`: Number of function executions that have resulted in errors
92
89
  * - `isPending`: Whether the throttler is waiting for the timeout to trigger execution
93
90
  * - `isExecuting`: Whether an async function execution is currently in progress
94
91
  * - `lastArgs`: The arguments from the most recent call to maybeExecute
95
- * - `lastError`: The error from the most recent failed execution (if any)
96
92
  * - `lastExecutionTime`: Timestamp of the last execution
97
93
  * - `lastResult`: The result from the most recent successful execution
98
94
  * - `nextExecutionTime`: Timestamp of the next allowed execution
99
- * - `status`: Current execution status ('disabled' | 'idle' | 'pending' | 'executing')
95
+ * - `status`: Current execution status ('disabled' | 'idle' | 'pending' | 'executing' | 'settled')
100
96
  *
101
97
  * ## Unmount behavior
102
98
  *
@@ -151,14 +147,12 @@ interface SolidAsyncThrottler<TFn extends AnyAsyncFunction, TSelected = {}> exte
151
147
  * console.error('API call failed:', error);
152
148
  * }
153
149
  * },
154
- * (state) => ({ hasError: state.hasError, lastError: state.lastError })
150
+ * (state) => ({ errorCount: state.errorCount })
155
151
  * );
156
152
  *
157
153
  * // Access the selected state (will be empty object {} unless selector provided)
158
154
  * const { isPending, isExecuting } = throttler.state();
159
155
  * ```
160
156
  */
161
- declare function createAsyncThrottler<TFn extends AnyAsyncFunction, TSelected = {}>(fn: TFn, options: SolidAsyncThrottlerOptions<TFn, TSelected>, selector?: (state: AsyncThrottlerState<TFn>) => TSelected): SolidAsyncThrottler<TFn, TSelected>;
162
- //#endregion
163
- export { SolidAsyncThrottler, SolidAsyncThrottlerOptions, createAsyncThrottler };
164
- //# sourceMappingURL=createAsyncThrottler.d.ts.map
157
+ export declare function createAsyncThrottler<TFn extends AnyAsyncFunction, TSelected = {}>(fn: TFn, options: SolidAsyncThrottlerOptions<TFn, TSelected>, selector?: (state: AsyncThrottlerState<TFn>) => TSelected): SolidAsyncThrottler<TFn, TSelected>;
158
+ //#endregion
@@ -47,18 +47,15 @@ import { AsyncThrottler } from "@tanstack/pacer/async-throttler";
47
47
  * updates and gives you full control over when your component tracks state changes.
48
48
  *
49
49
  * Available state properties:
50
- * - `canLeadingExecute`: Whether the throttler can execute on the leading edge
51
- * - `canTrailingExecute`: Whether the throttler can execute on the trailing edge
52
- * - `executionCount`: Number of function executions that have been completed
53
- * - `hasError`: Whether the last execution resulted in an error
50
+ * - `settleCount`: Number of function executions that have completed (success or error)
51
+ * - `errorCount`: Number of function executions that have resulted in errors
54
52
  * - `isPending`: Whether the throttler is waiting for the timeout to trigger execution
55
53
  * - `isExecuting`: Whether an async function execution is currently in progress
56
54
  * - `lastArgs`: The arguments from the most recent call to maybeExecute
57
- * - `lastError`: The error from the most recent failed execution (if any)
58
55
  * - `lastExecutionTime`: Timestamp of the last execution
59
56
  * - `lastResult`: The result from the most recent successful execution
60
57
  * - `nextExecutionTime`: Timestamp of the next allowed execution
61
- * - `status`: Current execution status ('disabled' | 'idle' | 'pending' | 'executing')
58
+ * - `status`: Current execution status ('disabled' | 'idle' | 'pending' | 'executing' | 'settled')
62
59
  *
63
60
  * ## Unmount behavior
64
61
  *
@@ -113,7 +110,7 @@ import { AsyncThrottler } from "@tanstack/pacer/async-throttler";
113
110
  * console.error('API call failed:', error);
114
111
  * }
115
112
  * },
116
- * (state) => ({ hasError: state.hasError, lastError: state.lastError })
113
+ * (state) => ({ errorCount: state.errorCount })
117
114
  * );
118
115
  *
119
116
  * // Access the selected state (will be empty object {} unless selector provided)
@@ -147,5 +144,4 @@ function createAsyncThrottler(fn, options, selector = () => ({})) {
147
144
  }
148
145
 
149
146
  //#endregion
150
- export { createAsyncThrottler };
151
- //# sourceMappingURL=createAsyncThrottler.js.map
147
+ export { createAsyncThrottler };
@@ -1,16 +1,15 @@
1
1
  import { Accessor, JSX } from "solid-js";
2
2
  import { Store } from "@tanstack/solid-store";
3
3
  import { Batcher, BatcherOptions, BatcherState } from "@tanstack/pacer/batcher";
4
-
5
4
  //#region src/batcher/createBatcher.d.ts
6
- interface SolidBatcherOptions<TValue, TSelected = {}> extends BatcherOptions<TValue> {
5
+ export interface SolidBatcherOptions<TValue, TSelected = {}> extends BatcherOptions<TValue> {
7
6
  /**
8
7
  * Optional callback invoked when the owning component unmounts. Receives the batcher instance.
9
8
  * When provided, replaces the default cleanup (cancel); use it to call flush(), reset(), cancel(), add logging, etc.
10
9
  */
11
10
  onUnmount?: (batcher: SolidBatcher<TValue, TSelected>) => void;
12
11
  }
13
- interface SolidBatcher<TValue, TSelected = {}> extends Omit<Batcher<TValue>, 'store'> {
12
+ export interface SolidBatcher<TValue, TSelected = {}> extends Omit<Batcher<TValue>, 'store'> {
14
13
  /**
15
14
  * A Solid component that allows you to subscribe to the batcher state.
16
15
  *
@@ -18,9 +17,9 @@ interface SolidBatcher<TValue, TSelected = {}> extends Omit<Batcher<TValue>, 'st
18
17
  * deep in your component tree without needing to pass a selector to the hook.
19
18
  *
20
19
  * @example
21
- * <batcher.Subscribe selector={(state) => ({ size: state.size, isRunning: state.isRunning })}>
20
+ * <batcher.Subscribe selector={(state) => ({ size: state.size, isPending: state.isPending })}>
22
21
  * {(state) => (
23
- * <div>Batch: {state().size} items, {state().isRunning ? 'Processing' : 'Idle'}</div>
22
+ * <div>Batch: {state().size} items, {state().isPending ? 'Pending' : 'Idle'}</div>
24
23
  * )}
25
24
  * </batcher.Subscribe>
26
25
  */
@@ -79,7 +78,6 @@ interface SolidBatcher<TValue, TSelected = {}> extends Omit<Batcher<TValue>, 'st
79
78
  *
80
79
  * Available state properties:
81
80
  * - `executionCount`: Number of batch executions that have been completed
82
- * - `isRunning`: Whether the batcher is currently running (not stopped)
83
81
  * - `items`: Array of items currently queued for batching
84
82
  * - `totalItemsProcessed`: Total number of individual items that have been processed across all batches
85
83
  *
@@ -112,11 +110,11 @@ interface SolidBatcher<TValue, TSelected = {}> extends Omit<Batcher<TValue>, 'st
112
110
  * }
113
111
  * );
114
112
  *
115
- * // Opt-in to track items or isRunning changes (optimized for UI updates)
113
+ * // Opt-in to track items or isPending changes (optimized for UI updates)
116
114
  * const batcher = createBatcher(
117
115
  * (items) => console.log('Processing batch:', items),
118
116
  * { maxSize: 5, wait: 2000 },
119
- * (state) => ({ items: state.items, isRunning: state.isRunning })
117
+ * (state) => ({ items: state.items, isPending: state.isPending })
120
118
  * );
121
119
  *
122
120
  * // Opt-in to track execution metrics changes (optimized for tracking progress)
@@ -134,14 +132,12 @@ interface SolidBatcher<TValue, TSelected = {}> extends Omit<Batcher<TValue>, 'st
134
132
  * batcher.addItem('task2');
135
133
  *
136
134
  * // Control the batcher
137
- * batcher.stop(); // Pause processing
138
- * batcher.start(); // Resume processing
135
+ * batcher.cancel(); // Cancel the pending timer; queued items are retained
136
+ * batcher.flush(); // Process queued items immediately
139
137
  *
140
138
  * // Access the selected state (will be empty object {} unless selector provided)
141
- * const { items, isRunning } = batcher.state();
139
+ * const { items, isPending } = batcher.state();
142
140
  * ```
143
141
  */
144
- declare function createBatcher<TValue, TSelected = {}>(fn: (items: Array<TValue>) => void, options?: SolidBatcherOptions<TValue, TSelected>, selector?: (state: BatcherState<TValue>) => TSelected): SolidBatcher<TValue, TSelected>;
145
- //#endregion
146
- export { SolidBatcher, SolidBatcherOptions, createBatcher };
147
- //# sourceMappingURL=createBatcher.d.ts.map
142
+ export declare function createBatcher<TValue, TSelected = {}>(fn: (items: Array<TValue>) => void, options?: SolidBatcherOptions<TValue, TSelected>, selector?: (state: BatcherState<TValue>) => TSelected): SolidBatcher<TValue, TSelected>;
143
+ //#endregion
@@ -42,7 +42,6 @@ import { Batcher } from "@tanstack/pacer/batcher";
42
42
  *
43
43
  * Available state properties:
44
44
  * - `executionCount`: Number of batch executions that have been completed
45
- * - `isRunning`: Whether the batcher is currently running (not stopped)
46
45
  * - `items`: Array of items currently queued for batching
47
46
  * - `totalItemsProcessed`: Total number of individual items that have been processed across all batches
48
47
  *
@@ -75,11 +74,11 @@ import { Batcher } from "@tanstack/pacer/batcher";
75
74
  * }
76
75
  * );
77
76
  *
78
- * // Opt-in to track items or isRunning changes (optimized for UI updates)
77
+ * // Opt-in to track items or isPending changes (optimized for UI updates)
79
78
  * const batcher = createBatcher(
80
79
  * (items) => console.log('Processing batch:', items),
81
80
  * { maxSize: 5, wait: 2000 },
82
- * (state) => ({ items: state.items, isRunning: state.isRunning })
81
+ * (state) => ({ items: state.items, isPending: state.isPending })
83
82
  * );
84
83
  *
85
84
  * // Opt-in to track execution metrics changes (optimized for tracking progress)
@@ -97,11 +96,11 @@ import { Batcher } from "@tanstack/pacer/batcher";
97
96
  * batcher.addItem('task2');
98
97
  *
99
98
  * // Control the batcher
100
- * batcher.stop(); // Pause processing
101
- * batcher.start(); // Resume processing
99
+ * batcher.cancel(); // Cancel the pending timer; queued items are retained
100
+ * batcher.flush(); // Process queued items immediately
102
101
  *
103
102
  * // Access the selected state (will be empty object {} unless selector provided)
104
- * const { items, isRunning } = batcher.state();
103
+ * const { items, isPending } = batcher.state();
105
104
  * ```
106
105
  */
107
106
  function createBatcher(fn, options = {}, selector = () => ({})) {
@@ -128,5 +127,4 @@ function createBatcher(fn, options = {}, selector = () => ({})) {
128
127
  }
129
128
 
130
129
  //#endregion
131
- export { createBatcher };
132
- //# sourceMappingURL=createBatcher.js.map
130
+ export { createBatcher };
@@ -1,7 +1,6 @@
1
1
  import { SolidDebouncer, SolidDebouncerOptions } from "./createDebouncer.js";
2
2
  import { Accessor, Setter } from "solid-js";
3
3
  import { DebouncerState } from "@tanstack/pacer/debouncer";
4
-
5
4
  //#region src/debouncer/createDebouncedSignal.d.ts
6
5
  /**
7
6
  * A Solid hook that creates a debounced state value, combining Solid's createSignal with debouncing functionality.
@@ -74,7 +73,5 @@ import { DebouncerState } from "@tanstack/pacer/debouncer";
74
73
  * });
75
74
  * ```
76
75
  */
77
- declare function createDebouncedSignal<TValue, TSelected = {}>(value: TValue, initialOptions: SolidDebouncerOptions<Setter<TValue>, TSelected>, selector?: (state: DebouncerState<Setter<TValue>>) => TSelected): [Accessor<TValue>, Setter<TValue>, SolidDebouncer<Setter<TValue>, TSelected>];
78
- //#endregion
79
- export { createDebouncedSignal };
80
- //# sourceMappingURL=createDebouncedSignal.d.ts.map
76
+ export declare function createDebouncedSignal<TValue, TSelected = {}>(value: TValue, initialOptions: SolidDebouncerOptions<Setter<TValue>, TSelected>, selector?: (state: DebouncerState<Setter<TValue>>) => TSelected): [Accessor<TValue>, Setter<TValue>, SolidDebouncer<Setter<TValue>, TSelected>];
77
+ //#endregion
@@ -84,5 +84,4 @@ function createDebouncedSignal(value, initialOptions, selector) {
84
84
  }
85
85
 
86
86
  //#endregion
87
- export { createDebouncedSignal };
88
- //# sourceMappingURL=createDebouncedSignal.js.map
87
+ export { createDebouncedSignal };