@tanstack/preact-pacer 0.23.0 → 0.24.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 (242) hide show
  1. package/dist/async-batcher/useAsyncBatchedCallback.d.ts +2 -4
  2. package/dist/async-batcher/useAsyncBatchedCallback.js +1 -2
  3. package/dist/async-batcher/useAsyncBatcher.d.ts +4 -7
  4. package/dist/async-batcher/useAsyncBatcher.js +1 -3
  5. package/dist/async-debouncer/useAsyncDebouncedCallback.d.ts +2 -4
  6. package/dist/async-debouncer/useAsyncDebouncedCallback.js +1 -2
  7. package/dist/async-debouncer/useAsyncDebouncer.d.ts +4 -6
  8. package/dist/async-debouncer/useAsyncDebouncer.js +1 -2
  9. package/dist/async-queuer/useAsyncQueuedState.d.ts +4 -6
  10. package/dist/async-queuer/useAsyncQueuedState.js +3 -4
  11. package/dist/async-queuer/useAsyncQueuer.d.ts +6 -8
  12. package/dist/async-queuer/useAsyncQueuer.js +3 -4
  13. package/dist/async-rate-limiter/useAsyncRateLimitedCallback.d.ts +2 -4
  14. package/dist/async-rate-limiter/useAsyncRateLimitedCallback.js +1 -2
  15. package/dist/async-rate-limiter/useAsyncRateLimiter.d.ts +4 -6
  16. package/dist/async-rate-limiter/useAsyncRateLimiter.js +1 -2
  17. package/dist/async-throttler/useAsyncThrottledCallback.d.ts +2 -4
  18. package/dist/async-throttler/useAsyncThrottledCallback.js +1 -2
  19. package/dist/async-throttler/useAsyncThrottler.d.ts +4 -6
  20. package/dist/async-throttler/useAsyncThrottler.js +1 -2
  21. package/dist/batcher/useBatchedCallback.d.ts +2 -4
  22. package/dist/batcher/useBatchedCallback.js +1 -2
  23. package/dist/batcher/useBatcher.d.ts +6 -10
  24. package/dist/batcher/useBatcher.js +3 -6
  25. package/dist/debouncer/useDebouncedCallback.d.ts +2 -4
  26. package/dist/debouncer/useDebouncedCallback.js +1 -2
  27. package/dist/debouncer/useDebouncedState.d.ts +2 -4
  28. package/dist/debouncer/useDebouncedState.js +1 -2
  29. package/dist/debouncer/useDebouncedValue.d.ts +2 -4
  30. package/dist/debouncer/useDebouncedValue.js +1 -2
  31. package/dist/debouncer/useDebouncer.d.ts +4 -6
  32. package/dist/debouncer/useDebouncer.js +1 -2
  33. package/dist/provider/PacerProvider.d.ts +6 -8
  34. package/dist/provider/PacerProvider.js +1 -2
  35. package/dist/queuer/useQueuedState.d.ts +2 -4
  36. package/dist/queuer/useQueuedState.js +1 -2
  37. package/dist/queuer/useQueuedValue.d.ts +2 -4
  38. package/dist/queuer/useQueuedValue.js +1 -2
  39. package/dist/queuer/useQueuer.d.ts +4 -6
  40. package/dist/queuer/useQueuer.js +1 -2
  41. package/dist/rate-limiter/useRateLimitedCallback.d.ts +2 -4
  42. package/dist/rate-limiter/useRateLimitedCallback.js +1 -2
  43. package/dist/rate-limiter/useRateLimitedState.d.ts +2 -4
  44. package/dist/rate-limiter/useRateLimitedState.js +1 -2
  45. package/dist/rate-limiter/useRateLimitedValue.d.ts +2 -4
  46. package/dist/rate-limiter/useRateLimitedValue.js +1 -2
  47. package/dist/rate-limiter/useRateLimiter.d.ts +4 -6
  48. package/dist/rate-limiter/useRateLimiter.js +1 -2
  49. package/dist/throttler/useThrottledCallback.d.ts +2 -4
  50. package/dist/throttler/useThrottledCallback.js +1 -2
  51. package/dist/throttler/useThrottledState.d.ts +2 -4
  52. package/dist/throttler/useThrottledState.js +1 -2
  53. package/dist/throttler/useThrottledValue.d.ts +2 -4
  54. package/dist/throttler/useThrottledValue.js +1 -2
  55. package/dist/throttler/useThrottler.d.ts +4 -6
  56. package/dist/throttler/useThrottler.js +1 -2
  57. package/package.json +22 -70
  58. package/dist/async-batcher/index.cjs +0 -13
  59. package/dist/async-batcher/index.d.cts +0 -4
  60. package/dist/async-batcher/useAsyncBatchedCallback.cjs +0 -51
  61. package/dist/async-batcher/useAsyncBatchedCallback.cjs.map +0 -1
  62. package/dist/async-batcher/useAsyncBatchedCallback.d.cts +0 -43
  63. package/dist/async-batcher/useAsyncBatchedCallback.js.map +0 -1
  64. package/dist/async-batcher/useAsyncBatcher.cjs +0 -217
  65. package/dist/async-batcher/useAsyncBatcher.cjs.map +0 -1
  66. package/dist/async-batcher/useAsyncBatcher.d.cts +0 -223
  67. package/dist/async-batcher/useAsyncBatcher.js.map +0 -1
  68. package/dist/async-debouncer/index.cjs +0 -13
  69. package/dist/async-debouncer/index.d.cts +0 -4
  70. package/dist/async-debouncer/useAsyncDebouncedCallback.cjs +0 -52
  71. package/dist/async-debouncer/useAsyncDebouncedCallback.cjs.map +0 -1
  72. package/dist/async-debouncer/useAsyncDebouncedCallback.d.cts +0 -47
  73. package/dist/async-debouncer/useAsyncDebouncedCallback.js.map +0 -1
  74. package/dist/async-debouncer/useAsyncDebouncer.cjs +0 -195
  75. package/dist/async-debouncer/useAsyncDebouncer.cjs.map +0 -1
  76. package/dist/async-debouncer/useAsyncDebouncer.d.cts +0 -202
  77. package/dist/async-debouncer/useAsyncDebouncer.js.map +0 -1
  78. package/dist/async-queuer/index.cjs +0 -13
  79. package/dist/async-queuer/index.d.cts +0 -4
  80. package/dist/async-queuer/useAsyncQueuedState.cjs +0 -154
  81. package/dist/async-queuer/useAsyncQueuedState.cjs.map +0 -1
  82. package/dist/async-queuer/useAsyncQueuedState.d.cts +0 -150
  83. package/dist/async-queuer/useAsyncQueuedState.js.map +0 -1
  84. package/dist/async-queuer/useAsyncQueuer.cjs +0 -217
  85. package/dist/async-queuer/useAsyncQueuer.cjs.map +0 -1
  86. package/dist/async-queuer/useAsyncQueuer.d.cts +0 -223
  87. package/dist/async-queuer/useAsyncQueuer.js.map +0 -1
  88. package/dist/async-rate-limiter/index.cjs +0 -13
  89. package/dist/async-rate-limiter/index.d.cts +0 -4
  90. package/dist/async-rate-limiter/useAsyncRateLimitedCallback.cjs +0 -65
  91. package/dist/async-rate-limiter/useAsyncRateLimitedCallback.cjs.map +0 -1
  92. package/dist/async-rate-limiter/useAsyncRateLimitedCallback.d.cts +0 -60
  93. package/dist/async-rate-limiter/useAsyncRateLimitedCallback.js.map +0 -1
  94. package/dist/async-rate-limiter/useAsyncRateLimiter.cjs +0 -209
  95. package/dist/async-rate-limiter/useAsyncRateLimiter.cjs.map +0 -1
  96. package/dist/async-rate-limiter/useAsyncRateLimiter.d.cts +0 -219
  97. package/dist/async-rate-limiter/useAsyncRateLimiter.js.map +0 -1
  98. package/dist/async-retryer/index.cjs +0 -8
  99. package/dist/async-retryer/index.d.cts +0 -1
  100. package/dist/async-throttler/index.cjs +0 -13
  101. package/dist/async-throttler/index.d.cts +0 -4
  102. package/dist/async-throttler/useAsyncThrottledCallback.cjs +0 -49
  103. package/dist/async-throttler/useAsyncThrottledCallback.cjs.map +0 -1
  104. package/dist/async-throttler/useAsyncThrottledCallback.d.cts +0 -44
  105. package/dist/async-throttler/useAsyncThrottledCallback.js.map +0 -1
  106. package/dist/async-throttler/useAsyncThrottler.cjs +0 -206
  107. package/dist/async-throttler/useAsyncThrottler.cjs.map +0 -1
  108. package/dist/async-throttler/useAsyncThrottler.d.cts +0 -213
  109. package/dist/async-throttler/useAsyncThrottler.js.map +0 -1
  110. package/dist/batcher/index.cjs +0 -13
  111. package/dist/batcher/index.d.cts +0 -4
  112. package/dist/batcher/useBatchedCallback.cjs +0 -47
  113. package/dist/batcher/useBatchedCallback.cjs.map +0 -1
  114. package/dist/batcher/useBatchedCallback.d.cts +0 -41
  115. package/dist/batcher/useBatchedCallback.js.map +0 -1
  116. package/dist/batcher/useBatcher.cjs +0 -165
  117. package/dist/batcher/useBatcher.cjs.map +0 -1
  118. package/dist/batcher/useBatcher.d.cts +0 -174
  119. package/dist/batcher/useBatcher.js.map +0 -1
  120. package/dist/debouncer/index.cjs +0 -17
  121. package/dist/debouncer/index.d.cts +0 -6
  122. package/dist/debouncer/useDebouncedCallback.cjs +0 -48
  123. package/dist/debouncer/useDebouncedCallback.cjs.map +0 -1
  124. package/dist/debouncer/useDebouncedCallback.d.cts +0 -43
  125. package/dist/debouncer/useDebouncedCallback.js.map +0 -1
  126. package/dist/debouncer/useDebouncedState.cjs +0 -89
  127. package/dist/debouncer/useDebouncedState.cjs.map +0 -1
  128. package/dist/debouncer/useDebouncedState.d.cts +0 -80
  129. package/dist/debouncer/useDebouncedState.js.map +0 -1
  130. package/dist/debouncer/useDebouncedValue.cjs +0 -96
  131. package/dist/debouncer/useDebouncedValue.cjs.map +0 -1
  132. package/dist/debouncer/useDebouncedValue.d.cts +0 -89
  133. package/dist/debouncer/useDebouncedValue.js.map +0 -1
  134. package/dist/debouncer/useDebouncer.cjs +0 -141
  135. package/dist/debouncer/useDebouncer.cjs.map +0 -1
  136. package/dist/debouncer/useDebouncer.d.cts +0 -151
  137. package/dist/debouncer/useDebouncer.js.map +0 -1
  138. package/dist/index.cjs +0 -67
  139. package/dist/index.d.cts +0 -30
  140. package/dist/provider/PacerProvider.cjs +0 -26
  141. package/dist/provider/PacerProvider.cjs.map +0 -1
  142. package/dist/provider/PacerProvider.d.cts +0 -28
  143. package/dist/provider/PacerProvider.js.map +0 -1
  144. package/dist/provider/index.cjs +0 -6
  145. package/dist/provider/index.d.cts +0 -2
  146. package/dist/queuer/index.cjs +0 -15
  147. package/dist/queuer/index.d.cts +0 -5
  148. package/dist/queuer/useQueuedState.cjs +0 -129
  149. package/dist/queuer/useQueuedState.cjs.map +0 -1
  150. package/dist/queuer/useQueuedState.d.cts +0 -121
  151. package/dist/queuer/useQueuedState.js.map +0 -1
  152. package/dist/queuer/useQueuedValue.cjs +0 -115
  153. package/dist/queuer/useQueuedValue.cjs.map +0 -1
  154. package/dist/queuer/useQueuedValue.d.cts +0 -104
  155. package/dist/queuer/useQueuedValue.js.map +0 -1
  156. package/dist/queuer/useQueuer.cjs +0 -176
  157. package/dist/queuer/useQueuer.cjs.map +0 -1
  158. package/dist/queuer/useQueuer.d.cts +0 -185
  159. package/dist/queuer/useQueuer.js.map +0 -1
  160. package/dist/rate-limiter/index.cjs +0 -17
  161. package/dist/rate-limiter/index.d.cts +0 -6
  162. package/dist/rate-limiter/useRateLimitedCallback.cjs +0 -65
  163. package/dist/rate-limiter/useRateLimitedCallback.cjs.map +0 -1
  164. package/dist/rate-limiter/useRateLimitedCallback.d.cts +0 -60
  165. package/dist/rate-limiter/useRateLimitedCallback.js.map +0 -1
  166. package/dist/rate-limiter/useRateLimitedState.cjs +0 -115
  167. package/dist/rate-limiter/useRateLimitedState.cjs.map +0 -1
  168. package/dist/rate-limiter/useRateLimitedState.d.cts +0 -106
  169. package/dist/rate-limiter/useRateLimitedState.js.map +0 -1
  170. package/dist/rate-limiter/useRateLimitedValue.cjs +0 -102
  171. package/dist/rate-limiter/useRateLimitedValue.cjs.map +0 -1
  172. package/dist/rate-limiter/useRateLimitedValue.d.cts +0 -95
  173. package/dist/rate-limiter/useRateLimitedValue.js.map +0 -1
  174. package/dist/rate-limiter/useRateLimiter.cjs +0 -167
  175. package/dist/rate-limiter/useRateLimiter.cjs.map +0 -1
  176. package/dist/rate-limiter/useRateLimiter.d.cts +0 -178
  177. package/dist/rate-limiter/useRateLimiter.js.map +0 -1
  178. package/dist/throttler/index.cjs +0 -17
  179. package/dist/throttler/index.d.cts +0 -6
  180. package/dist/throttler/useThrottledCallback.cjs +0 -49
  181. package/dist/throttler/useThrottledCallback.cjs.map +0 -1
  182. package/dist/throttler/useThrottledCallback.d.cts +0 -44
  183. package/dist/throttler/useThrottledCallback.js.map +0 -1
  184. package/dist/throttler/useThrottledState.cjs +0 -100
  185. package/dist/throttler/useThrottledState.cjs.map +0 -1
  186. package/dist/throttler/useThrottledState.d.cts +0 -91
  187. package/dist/throttler/useThrottledState.js.map +0 -1
  188. package/dist/throttler/useThrottledValue.cjs +0 -91
  189. package/dist/throttler/useThrottledValue.cjs.map +0 -1
  190. package/dist/throttler/useThrottledValue.d.cts +0 -84
  191. package/dist/throttler/useThrottledValue.js.map +0 -1
  192. package/dist/throttler/useThrottler.cjs +0 -146
  193. package/dist/throttler/useThrottler.cjs.map +0 -1
  194. package/dist/throttler/useThrottler.d.cts +0 -156
  195. package/dist/throttler/useThrottler.js.map +0 -1
  196. package/dist/types/index.cjs +0 -8
  197. package/dist/types/index.d.cts +0 -1
  198. package/dist/utils/index.cjs +0 -8
  199. package/dist/utils/index.d.cts +0 -1
  200. package/src/async-batcher/index.ts +0 -4
  201. package/src/async-batcher/useAsyncBatchedCallback.ts +0 -53
  202. package/src/async-batcher/useAsyncBatcher.ts +0 -293
  203. package/src/async-debouncer/index.ts +0 -5
  204. package/src/async-debouncer/useAsyncDebouncedCallback.ts +0 -55
  205. package/src/async-debouncer/useAsyncDebouncer.ts +0 -274
  206. package/src/async-queuer/index.ts +0 -4
  207. package/src/async-queuer/useAsyncQueuedState.ts +0 -165
  208. package/src/async-queuer/useAsyncQueuer.ts +0 -293
  209. package/src/async-rate-limiter/index.ts +0 -5
  210. package/src/async-rate-limiter/useAsyncRateLimitedCallback.ts +0 -68
  211. package/src/async-rate-limiter/useAsyncRateLimiter.ts +0 -294
  212. package/src/async-retryer/index.ts +0 -2
  213. package/src/async-throttler/index.ts +0 -5
  214. package/src/async-throttler/useAsyncThrottledCallback.ts +0 -52
  215. package/src/async-throttler/useAsyncThrottler.ts +0 -285
  216. package/src/batcher/index.ts +0 -4
  217. package/src/batcher/useBatchedCallback.ts +0 -46
  218. package/src/batcher/useBatcher.ts +0 -241
  219. package/src/debouncer/index.ts +0 -7
  220. package/src/debouncer/useDebouncedCallback.ts +0 -51
  221. package/src/debouncer/useDebouncedState.ts +0 -106
  222. package/src/debouncer/useDebouncedValue.ts +0 -109
  223. package/src/debouncer/useDebouncer.ts +0 -219
  224. package/src/index.ts +0 -56
  225. package/src/provider/PacerProvider.tsx +0 -70
  226. package/src/provider/index.ts +0 -1
  227. package/src/queuer/index.ts +0 -5
  228. package/src/queuer/useQueuedState.ts +0 -133
  229. package/src/queuer/useQueuedValue.ts +0 -129
  230. package/src/queuer/useQueuer.ts +0 -251
  231. package/src/rate-limiter/index.ts +0 -6
  232. package/src/rate-limiter/useRateLimitedCallback.ts +0 -68
  233. package/src/rate-limiter/useRateLimitedState.ts +0 -124
  234. package/src/rate-limiter/useRateLimitedValue.ts +0 -110
  235. package/src/rate-limiter/useRateLimiter.ts +0 -244
  236. package/src/throttler/index.ts +0 -7
  237. package/src/throttler/useThrottledCallback.ts +0 -52
  238. package/src/throttler/useThrottledState.ts +0 -118
  239. package/src/throttler/useThrottledValue.ts +0 -104
  240. package/src/throttler/useThrottler.ts +0 -224
  241. package/src/types/index.ts +0 -1
  242. package/src/utils/index.ts +0 -1
@@ -37,7 +37,5 @@ import { PreactAsyncBatcherOptions } from "./useAsyncBatcher.js";
37
37
  * </button>
38
38
  * ```
39
39
  */
40
- declare function useAsyncBatchedCallback<TValue>(fn: (items: Array<TValue>) => Promise<unknown>, options: PreactAsyncBatcherOptions<TValue, {}>): (item: TValue) => Promise<void>;
41
- //#endregion
42
- export { useAsyncBatchedCallback };
43
- //# sourceMappingURL=useAsyncBatchedCallback.d.ts.map
40
+ export declare function useAsyncBatchedCallback<TValue>(fn: (items: Array<TValue>) => Promise<unknown>, options: PreactAsyncBatcherOptions<TValue, {}>): (item: TValue) => Promise<void>;
41
+ //#endregion
@@ -47,5 +47,4 @@ function useAsyncBatchedCallback(fn, options) {
47
47
  }
48
48
 
49
49
  //#endregion
50
- export { useAsyncBatchedCallback };
51
- //# sourceMappingURL=useAsyncBatchedCallback.js.map
50
+ export { useAsyncBatchedCallback };
@@ -2,14 +2,14 @@ import { ComponentChildren } from "preact";
2
2
  import { AsyncBatcher, AsyncBatcherOptions, AsyncBatcherState } from "@tanstack/pacer/async-batcher";
3
3
  import { Store } from "@tanstack/preact-store";
4
4
  //#region src/async-batcher/useAsyncBatcher.d.ts
5
- interface PreactAsyncBatcherOptions<TValue, TSelected = {}> extends AsyncBatcherOptions<TValue> {
5
+ export interface PreactAsyncBatcherOptions<TValue, TSelected = {}> extends AsyncBatcherOptions<TValue> {
6
6
  /**
7
7
  * Optional callback invoked when the component unmounts. Receives the batcher instance.
8
8
  * When provided, replaces the default cleanup (cancel + abort); use it to call flush(), reset(), cancel(), add logging, etc.
9
9
  */
10
10
  onUnmount?: (batcher: PreactAsyncBatcher<TValue, TSelected>) => void;
11
11
  }
12
- interface PreactAsyncBatcher<TValue, TSelected = {}> extends Omit<AsyncBatcher<TValue>, 'store'> {
12
+ export interface PreactAsyncBatcher<TValue, TSelected = {}> extends Omit<AsyncBatcher<TValue>, 'store'> {
13
13
  /**
14
14
  * A Preact HOC (Higher Order Component) that allows you to subscribe to the async batcher state.
15
15
  *
@@ -96,7 +96,6 @@ interface PreactAsyncBatcher<TValue, TSelected = {}> extends Omit<AsyncBatcher<T
96
96
  * - `isEmpty`: Whether the batcher has no items to process
97
97
  * - `isExecuting`: Whether a batch is currently being processed asynchronously
98
98
  * - `isPending`: Whether the batcher is waiting for the timeout to trigger batch processing
99
- * - `isRunning`: Whether the batcher is active and will process items automatically
100
99
  * - `items`: Array of items currently queued for batch processing
101
100
  * - `lastResult`: The result from the most recent batch execution
102
101
  * - `settleCount`: Number of batch executions that have completed (success or error)
@@ -217,7 +216,5 @@ interface PreactAsyncBatcher<TValue, TSelected = {}> extends Omit<AsyncBatcher<T
217
216
  * const { isExecuting, lastResult, size } = asyncBatcher.state;
218
217
  * ```
219
218
  */
220
- declare function useAsyncBatcher<TValue, TSelected = {}>(fn: (items: Array<TValue>) => Promise<any>, options?: PreactAsyncBatcherOptions<TValue, TSelected>, selector?: (state: AsyncBatcherState<TValue>) => TSelected): PreactAsyncBatcher<TValue, TSelected>;
221
- //#endregion
222
- export { PreactAsyncBatcher, PreactAsyncBatcherOptions, useAsyncBatcher };
223
- //# sourceMappingURL=useAsyncBatcher.d.ts.map
219
+ export declare function useAsyncBatcher<TValue, TSelected = {}>(fn: (items: Array<TValue>) => Promise<any>, options?: PreactAsyncBatcherOptions<TValue, TSelected>, selector?: (state: AsyncBatcherState<TValue>) => TSelected): PreactAsyncBatcher<TValue, TSelected>;
220
+ //#endregion
@@ -60,7 +60,6 @@ import { shallow, useSelector } from "@tanstack/preact-store";
60
60
  * - `isEmpty`: Whether the batcher has no items to process
61
61
  * - `isExecuting`: Whether a batch is currently being processed asynchronously
62
62
  * - `isPending`: Whether the batcher is waiting for the timeout to trigger batch processing
63
- * - `isRunning`: Whether the batcher is active and will process items automatically
64
63
  * - `items`: Array of items currently queued for batch processing
65
64
  * - `lastResult`: The result from the most recent batch execution
66
65
  * - `settleCount`: Number of batch executions that have completed (success or error)
@@ -213,5 +212,4 @@ function useAsyncBatcher(fn, options = {}, selector = () => ({})) {
213
212
  }
214
213
 
215
214
  //#endregion
216
- export { useAsyncBatcher };
217
- //# sourceMappingURL=useAsyncBatcher.js.map
215
+ export { useAsyncBatcher };
@@ -41,7 +41,5 @@ import { AnyAsyncFunction } from "@tanstack/pacer/types";
41
41
  * />
42
42
  * ```
43
43
  */
44
- declare function useAsyncDebouncedCallback<TFn extends AnyAsyncFunction>(fn: TFn, options: PreactAsyncDebouncerOptions<TFn, {}>): (...args: Parameters<TFn>) => Promise<Awaited<ReturnType<TFn>> | undefined>;
45
- //#endregion
46
- export { useAsyncDebouncedCallback };
47
- //# sourceMappingURL=useAsyncDebouncedCallback.d.ts.map
44
+ export declare function useAsyncDebouncedCallback<TFn extends AnyAsyncFunction>(fn: TFn, options: PreactAsyncDebouncerOptions<TFn, {}>): (...args: Parameters<TFn>) => Promise<Awaited<ReturnType<TFn>> | undefined>;
45
+ //#endregion
@@ -48,5 +48,4 @@ function useAsyncDebouncedCallback(fn, options) {
48
48
  }
49
49
 
50
50
  //#endregion
51
- export { useAsyncDebouncedCallback };
52
- //# sourceMappingURL=useAsyncDebouncedCallback.js.map
51
+ export { useAsyncDebouncedCallback };
@@ -3,14 +3,14 @@ import { Store } from "@tanstack/preact-store";
3
3
  import { AsyncDebouncer, AsyncDebouncerOptions, AsyncDebouncerState } from "@tanstack/pacer/async-debouncer";
4
4
  import { AnyAsyncFunction } from "@tanstack/pacer/types";
5
5
  //#region src/async-debouncer/useAsyncDebouncer.d.ts
6
- interface PreactAsyncDebouncerOptions<TFn extends AnyAsyncFunction, TSelected = {}> extends AsyncDebouncerOptions<TFn> {
6
+ export interface PreactAsyncDebouncerOptions<TFn extends AnyAsyncFunction, TSelected = {}> extends AsyncDebouncerOptions<TFn> {
7
7
  /**
8
8
  * Optional callback invoked when the component unmounts. Receives the debouncer instance.
9
9
  * When provided, replaces the default cleanup (cancel + abort); use it to call flush(), reset(), cancel(), add logging, etc.
10
10
  */
11
11
  onUnmount?: (debouncer: PreactAsyncDebouncer<TFn, TSelected>) => void;
12
12
  }
13
- interface PreactAsyncDebouncer<TFn extends AnyAsyncFunction, TSelected = {}> extends Omit<AsyncDebouncer<TFn>, 'store'> {
13
+ export interface PreactAsyncDebouncer<TFn extends AnyAsyncFunction, TSelected = {}> extends Omit<AsyncDebouncer<TFn>, 'store'> {
14
14
  /**
15
15
  * A Preact HOC (Higher Order Component) that allows you to subscribe to the async debouncer state.
16
16
  *
@@ -196,7 +196,5 @@ interface PreactAsyncDebouncer<TFn extends AnyAsyncFunction, TSelected = {}> ext
196
196
  * const { isExecuting, lastResult } = state;
197
197
  * ```
198
198
  */
199
- declare function useAsyncDebouncer<TFn extends AnyAsyncFunction, TSelected = {}>(fn: TFn, options: PreactAsyncDebouncerOptions<TFn, TSelected>, selector?: (state: AsyncDebouncerState<TFn>) => TSelected): PreactAsyncDebouncer<TFn, TSelected>;
200
- //#endregion
201
- export { PreactAsyncDebouncer, PreactAsyncDebouncerOptions, useAsyncDebouncer };
202
- //# sourceMappingURL=useAsyncDebouncer.d.ts.map
199
+ export declare function useAsyncDebouncer<TFn extends AnyAsyncFunction, TSelected = {}>(fn: TFn, options: PreactAsyncDebouncerOptions<TFn, TSelected>, selector?: (state: AsyncDebouncerState<TFn>) => TSelected): PreactAsyncDebouncer<TFn, TSelected>;
200
+ //#endregion
@@ -191,5 +191,4 @@ function useAsyncDebouncer(fn, options, selector = () => ({})) {
191
191
  }
192
192
 
193
193
  //#endregion
194
- export { useAsyncDebouncer };
195
- //# sourceMappingURL=useAsyncDebouncer.js.map
194
+ export { useAsyncDebouncer };
@@ -45,7 +45,7 @@ import { AsyncQueuerState } from "@tanstack/pacer/async-queuer";
45
45
  * - `lastResult`: The result from the most recent task execution
46
46
  * - `pendingTick`: Whether the queuer has a pending timeout for processing the next item
47
47
  * - `rejectionCount`: Number of items that have been rejected from being added
48
- * - `settledCount`: Number of task executions that have completed (success or error)
48
+ * - `settleCount`: Number of task executions that have completed (success or error)
49
49
  * - `size`: Number of items currently in the queue
50
50
  * - `status`: Current processing status ('idle' | 'running' | 'stopped')
51
51
  * - `successCount`: Number of task executions that have completed successfully
@@ -106,7 +106,7 @@ import { AsyncQueuerState } from "@tanstack/pacer/async-queuer";
106
106
  * (state) => ({
107
107
  * successCount: state.successCount,
108
108
  * errorCount: state.errorCount,
109
- * settledCount: state.settledCount,
109
+ * settleCount: state.settleCount,
110
110
  * expirationCount: state.expirationCount,
111
111
  * rejectionCount: state.rejectionCount
112
112
  * })
@@ -144,7 +144,5 @@ import { AsyncQueuerState } from "@tanstack/pacer/async-queuer";
144
144
  * const { size, isRunning, activeItems } = asyncQueuer.state;
145
145
  * ```
146
146
  */
147
- declare function useAsyncQueuedState<TValue, TSelected extends Pick<AsyncQueuerState<TValue>, 'items'> = Pick<AsyncQueuerState<TValue>, 'items'>>(fn: (value: TValue) => Promise<any>, options?: PreactAsyncQueuerOptions<TValue, TSelected>, selector?: (state: AsyncQueuerState<TValue>) => TSelected): [Array<TValue>, PreactAsyncQueuer<TValue, TSelected>];
148
- //#endregion
149
- export { useAsyncQueuedState };
150
- //# sourceMappingURL=useAsyncQueuedState.d.ts.map
147
+ export declare function useAsyncQueuedState<TValue, TSelected extends Pick<AsyncQueuerState<TValue>, 'items'> = Pick<AsyncQueuerState<TValue>, 'items'>>(fn: (value: TValue) => Promise<any>, options?: PreactAsyncQueuerOptions<TValue, TSelected>, selector?: (state: AsyncQueuerState<TValue>) => TSelected): [Array<TValue>, PreactAsyncQueuer<TValue, TSelected>];
148
+ //#endregion
@@ -45,7 +45,7 @@ import { useAsyncQueuer } from "./useAsyncQueuer.js";
45
45
  * - `lastResult`: The result from the most recent task execution
46
46
  * - `pendingTick`: Whether the queuer has a pending timeout for processing the next item
47
47
  * - `rejectionCount`: Number of items that have been rejected from being added
48
- * - `settledCount`: Number of task executions that have completed (success or error)
48
+ * - `settleCount`: Number of task executions that have completed (success or error)
49
49
  * - `size`: Number of items currently in the queue
50
50
  * - `status`: Current processing status ('idle' | 'running' | 'stopped')
51
51
  * - `successCount`: Number of task executions that have completed successfully
@@ -106,7 +106,7 @@ import { useAsyncQueuer } from "./useAsyncQueuer.js";
106
106
  * (state) => ({
107
107
  * successCount: state.successCount,
108
108
  * errorCount: state.errorCount,
109
- * settledCount: state.settledCount,
109
+ * settleCount: state.settleCount,
110
110
  * expirationCount: state.expirationCount,
111
111
  * rejectionCount: state.rejectionCount
112
112
  * })
@@ -150,5 +150,4 @@ function useAsyncQueuedState(fn, options = {}, selector) {
150
150
  }
151
151
 
152
152
  //#endregion
153
- export { useAsyncQueuedState };
154
- //# sourceMappingURL=useAsyncQueuedState.js.map
153
+ export { useAsyncQueuedState };
@@ -2,14 +2,14 @@ import { ComponentChildren } from "preact";
2
2
  import { Store } from "@tanstack/preact-store";
3
3
  import { AsyncQueuer, AsyncQueuerOptions, AsyncQueuerState } from "@tanstack/pacer/async-queuer";
4
4
  //#region src/async-queuer/useAsyncQueuer.d.ts
5
- interface PreactAsyncQueuerOptions<TValue, TSelected = {}> extends AsyncQueuerOptions<TValue> {
5
+ export interface PreactAsyncQueuerOptions<TValue, TSelected = {}> extends AsyncQueuerOptions<TValue> {
6
6
  /**
7
7
  * Optional callback invoked when the component unmounts. Receives the queuer instance.
8
8
  * When provided, replaces the default cleanup (stop + abort); use it to call flush(), flushAsBatch(), stop(), add logging, etc.
9
9
  */
10
10
  onUnmount?: (queuer: PreactAsyncQueuer<TValue, TSelected>) => void;
11
11
  }
12
- interface PreactAsyncQueuer<TValue, TSelected = {}> extends Omit<AsyncQueuer<TValue>, 'store'> {
12
+ export interface PreactAsyncQueuer<TValue, TSelected = {}> extends Omit<AsyncQueuer<TValue>, 'store'> {
13
13
  /**
14
14
  * A Preact HOC (Higher Order Component) that allows you to subscribe to the async queuer state.
15
15
  *
@@ -96,7 +96,7 @@ interface PreactAsyncQueuer<TValue, TSelected = {}> extends Omit<AsyncQueuer<TVa
96
96
  * - `lastResult`: The result from the most recent task execution
97
97
  * - `pendingTick`: Whether the queuer has a pending timeout for processing the next item
98
98
  * - `rejectionCount`: Number of items that have been rejected from being added
99
- * - `settledCount`: Number of task executions that have completed (success or error)
99
+ * - `settleCount`: Number of task executions that have completed (success or error)
100
100
  * - `size`: Number of items currently in the queue
101
101
  * - `status`: Current processing status ('idle' | 'running' | 'stopped')
102
102
  * - `successCount`: Number of task executions that have completed successfully
@@ -178,7 +178,7 @@ interface PreactAsyncQueuer<TValue, TSelected = {}> extends Omit<AsyncQueuer<TVa
178
178
  * (state) => ({
179
179
  * successCount: state.successCount,
180
180
  * errorCount: state.errorCount,
181
- * settledCount: state.settledCount,
181
+ * settleCount: state.settleCount,
182
182
  * expirationCount: state.expirationCount,
183
183
  * rejectionCount: state.rejectionCount
184
184
  * })
@@ -217,7 +217,5 @@ interface PreactAsyncQueuer<TValue, TSelected = {}> extends Omit<AsyncQueuer<TVa
217
217
  * const { size, isRunning, activeItems } = asyncQueuer.state;
218
218
  * ```
219
219
  */
220
- declare function useAsyncQueuer<TValue, TSelected = {}>(fn: (value: TValue) => Promise<any>, options?: PreactAsyncQueuerOptions<TValue, TSelected>, selector?: (state: AsyncQueuerState<TValue>) => TSelected): PreactAsyncQueuer<TValue, TSelected>;
221
- //#endregion
222
- export { PreactAsyncQueuer, PreactAsyncQueuerOptions, useAsyncQueuer };
223
- //# sourceMappingURL=useAsyncQueuer.d.ts.map
220
+ export declare function useAsyncQueuer<TValue, TSelected = {}>(fn: (value: TValue) => Promise<any>, options?: PreactAsyncQueuerOptions<TValue, TSelected>, selector?: (state: AsyncQueuerState<TValue>) => TSelected): PreactAsyncQueuer<TValue, TSelected>;
221
+ //#endregion
@@ -60,7 +60,7 @@ import { AsyncQueuer } from "@tanstack/pacer/async-queuer";
60
60
  * - `lastResult`: The result from the most recent task execution
61
61
  * - `pendingTick`: Whether the queuer has a pending timeout for processing the next item
62
62
  * - `rejectionCount`: Number of items that have been rejected from being added
63
- * - `settledCount`: Number of task executions that have completed (success or error)
63
+ * - `settleCount`: Number of task executions that have completed (success or error)
64
64
  * - `size`: Number of items currently in the queue
65
65
  * - `status`: Current processing status ('idle' | 'running' | 'stopped')
66
66
  * - `successCount`: Number of task executions that have completed successfully
@@ -142,7 +142,7 @@ import { AsyncQueuer } from "@tanstack/pacer/async-queuer";
142
142
  * (state) => ({
143
143
  * successCount: state.successCount,
144
144
  * errorCount: state.errorCount,
145
- * settledCount: state.settledCount,
145
+ * settleCount: state.settleCount,
146
146
  * expirationCount: state.expirationCount,
147
147
  * rejectionCount: state.rejectionCount
148
148
  * })
@@ -213,5 +213,4 @@ function useAsyncQueuer(fn, options = {}, selector = () => ({})) {
213
213
  }
214
214
 
215
215
  //#endregion
216
- export { useAsyncQueuer };
217
- //# sourceMappingURL=useAsyncQueuer.js.map
216
+ export { useAsyncQueuer };
@@ -54,7 +54,5 @@ import { AnyAsyncFunction } from "@tanstack/pacer/types";
54
54
  * );
55
55
  * ```
56
56
  */
57
- declare function useAsyncRateLimitedCallback<TFn extends AnyAsyncFunction>(fn: TFn, options: PreactAsyncRateLimiterOptions<TFn, {}>): (...args: Parameters<TFn>) => Promise<Awaited<ReturnType<TFn>> | undefined>;
58
- //#endregion
59
- export { useAsyncRateLimitedCallback };
60
- //# sourceMappingURL=useAsyncRateLimitedCallback.d.ts.map
57
+ export declare function useAsyncRateLimitedCallback<TFn extends AnyAsyncFunction>(fn: TFn, options: PreactAsyncRateLimiterOptions<TFn, {}>): (...args: Parameters<TFn>) => Promise<Awaited<ReturnType<TFn>> | undefined>;
58
+ //#endregion
@@ -61,5 +61,4 @@ function useAsyncRateLimitedCallback(fn, options) {
61
61
  }
62
62
 
63
63
  //#endregion
64
- export { useAsyncRateLimitedCallback };
65
- //# sourceMappingURL=useAsyncRateLimitedCallback.js.map
64
+ export { useAsyncRateLimitedCallback };
@@ -3,14 +3,14 @@ import { Store } from "@tanstack/preact-store";
3
3
  import { AsyncRateLimiter, AsyncRateLimiterOptions, AsyncRateLimiterState } from "@tanstack/pacer/async-rate-limiter";
4
4
  import { AnyAsyncFunction } from "@tanstack/pacer/types";
5
5
  //#region src/async-rate-limiter/useAsyncRateLimiter.d.ts
6
- interface PreactAsyncRateLimiterOptions<TFn extends AnyAsyncFunction, TSelected = {}> extends AsyncRateLimiterOptions<TFn> {
6
+ export interface PreactAsyncRateLimiterOptions<TFn extends AnyAsyncFunction, TSelected = {}> extends AsyncRateLimiterOptions<TFn> {
7
7
  /**
8
8
  * Optional callback invoked when the component unmounts. Receives the rate limiter instance.
9
9
  * When provided, replaces the default cleanup (abort); use it to call reset(), add logging, etc.
10
10
  */
11
11
  onUnmount?: (rateLimiter: PreactAsyncRateLimiter<TFn, TSelected>) => void;
12
12
  }
13
- interface PreactAsyncRateLimiter<TFn extends AnyAsyncFunction, TSelected = {}> extends Omit<AsyncRateLimiter<TFn>, 'store'> {
13
+ export interface PreactAsyncRateLimiter<TFn extends AnyAsyncFunction, TSelected = {}> extends Omit<AsyncRateLimiter<TFn>, 'store'> {
14
14
  /**
15
15
  * A Preact HOC (Higher Order Component) that allows you to subscribe to the async rate limiter state.
16
16
  *
@@ -213,7 +213,5 @@ interface PreactAsyncRateLimiter<TFn extends AnyAsyncFunction, TSelected = {}> e
213
213
  * const { isExecuting, lastResult, rejectionCount } = state;
214
214
  * ```
215
215
  */
216
- declare function useAsyncRateLimiter<TFn extends AnyAsyncFunction, TSelected = {}>(fn: TFn, options: PreactAsyncRateLimiterOptions<TFn, TSelected>, selector?: (state: AsyncRateLimiterState<TFn>) => TSelected): PreactAsyncRateLimiter<TFn, TSelected>;
217
- //#endregion
218
- export { PreactAsyncRateLimiter, PreactAsyncRateLimiterOptions, useAsyncRateLimiter };
219
- //# sourceMappingURL=useAsyncRateLimiter.d.ts.map
216
+ export declare function useAsyncRateLimiter<TFn extends AnyAsyncFunction, TSelected = {}>(fn: TFn, options: PreactAsyncRateLimiterOptions<TFn, TSelected>, selector?: (state: AsyncRateLimiterState<TFn>) => TSelected): PreactAsyncRateLimiter<TFn, TSelected>;
217
+ //#endregion
@@ -205,5 +205,4 @@ function useAsyncRateLimiter(fn, options, selector = () => ({})) {
205
205
  }
206
206
 
207
207
  //#endregion
208
- export { useAsyncRateLimiter };
209
- //# sourceMappingURL=useAsyncRateLimiter.js.map
208
+ export { useAsyncRateLimiter };
@@ -38,7 +38,5 @@ import { AnyAsyncFunction } from "@tanstack/pacer/types";
38
38
  * <button onClick={() => handleApiCall(formData)}>Send</button>
39
39
  * ```
40
40
  */
41
- declare function useAsyncThrottledCallback<TFn extends AnyAsyncFunction>(fn: TFn, options: PreactAsyncThrottlerOptions<TFn, {}>): (...args: Parameters<TFn>) => Promise<Awaited<ReturnType<TFn>> | undefined>;
42
- //#endregion
43
- export { useAsyncThrottledCallback };
44
- //# sourceMappingURL=useAsyncThrottledCallback.d.ts.map
41
+ export declare function useAsyncThrottledCallback<TFn extends AnyAsyncFunction>(fn: TFn, options: PreactAsyncThrottlerOptions<TFn, {}>): (...args: Parameters<TFn>) => Promise<Awaited<ReturnType<TFn>> | undefined>;
42
+ //#endregion
@@ -45,5 +45,4 @@ function useAsyncThrottledCallback(fn, options) {
45
45
  }
46
46
 
47
47
  //#endregion
48
- export { useAsyncThrottledCallback };
49
- //# sourceMappingURL=useAsyncThrottledCallback.js.map
48
+ export { useAsyncThrottledCallback };
@@ -3,14 +3,14 @@ import { Store } from "@tanstack/preact-store";
3
3
  import { AsyncThrottler, AsyncThrottlerOptions, AsyncThrottlerState } from "@tanstack/pacer/async-throttler";
4
4
  import { AnyAsyncFunction } from "@tanstack/pacer/types";
5
5
  //#region src/async-throttler/useAsyncThrottler.d.ts
6
- interface PreactAsyncThrottlerOptions<TFn extends AnyAsyncFunction, TSelected = {}> extends AsyncThrottlerOptions<TFn> {
6
+ export interface PreactAsyncThrottlerOptions<TFn extends AnyAsyncFunction, TSelected = {}> extends AsyncThrottlerOptions<TFn> {
7
7
  /**
8
8
  * Optional callback invoked when the component unmounts. Receives the throttler instance.
9
9
  * When provided, replaces the default cleanup (cancel + abort); use it to call flush(), reset(), cancel(), add logging, etc.
10
10
  */
11
11
  onUnmount?: (throttler: PreactAsyncThrottler<TFn, TSelected>) => void;
12
12
  }
13
- interface PreactAsyncThrottler<TFn extends AnyAsyncFunction, TSelected = {}> extends Omit<AsyncThrottler<TFn>, 'store'> {
13
+ export interface PreactAsyncThrottler<TFn extends AnyAsyncFunction, TSelected = {}> extends Omit<AsyncThrottler<TFn>, 'store'> {
14
14
  /**
15
15
  * A Preact HOC (Higher Order Component) that allows you to subscribe to the async throttler state.
16
16
  *
@@ -207,7 +207,5 @@ interface PreactAsyncThrottler<TFn extends AnyAsyncFunction, TSelected = {}> ext
207
207
  * const { isExecuting, lastResult } = state;
208
208
  * ```
209
209
  */
210
- declare function useAsyncThrottler<TFn extends AnyAsyncFunction, TSelected = {}>(fn: TFn, options: PreactAsyncThrottlerOptions<TFn, TSelected>, selector?: (state: AsyncThrottlerState<TFn>) => TSelected): PreactAsyncThrottler<TFn, TSelected>;
211
- //#endregion
212
- export { PreactAsyncThrottler, PreactAsyncThrottlerOptions, useAsyncThrottler };
213
- //# sourceMappingURL=useAsyncThrottler.d.ts.map
210
+ export declare function useAsyncThrottler<TFn extends AnyAsyncFunction, TSelected = {}>(fn: TFn, options: PreactAsyncThrottlerOptions<TFn, TSelected>, selector?: (state: AsyncThrottlerState<TFn>) => TSelected): PreactAsyncThrottler<TFn, TSelected>;
211
+ //#endregion
@@ -202,5 +202,4 @@ function useAsyncThrottler(fn, options, selector = () => ({})) {
202
202
  }
203
203
 
204
204
  //#endregion
205
- export { useAsyncThrottler };
206
- //# sourceMappingURL=useAsyncThrottler.js.map
205
+ export { useAsyncThrottler };
@@ -35,7 +35,5 @@ import { PreactBatcherOptions } from "./useBatcher.js";
35
35
  * </button>
36
36
  * ```
37
37
  */
38
- declare function useBatchedCallback<TValue>(fn: (items: Array<TValue>) => void, options: PreactBatcherOptions<TValue, {}>): (item: TValue) => void;
39
- //#endregion
40
- export { useBatchedCallback };
41
- //# sourceMappingURL=useBatchedCallback.d.ts.map
38
+ export declare function useBatchedCallback<TValue>(fn: (items: Array<TValue>) => void, options: PreactBatcherOptions<TValue, {}>): (item: TValue) => void;
39
+ //#endregion
@@ -43,5 +43,4 @@ function useBatchedCallback(fn, options) {
43
43
  }
44
44
 
45
45
  //#endregion
46
- export { useBatchedCallback };
47
- //# sourceMappingURL=useBatchedCallback.js.map
46
+ export { useBatchedCallback };
@@ -2,14 +2,14 @@ import { ComponentChildren } from "preact";
2
2
  import { Store } from "@tanstack/preact-store";
3
3
  import { Batcher, BatcherOptions, BatcherState } from "@tanstack/pacer/batcher";
4
4
  //#region src/batcher/useBatcher.d.ts
5
- interface PreactBatcherOptions<TValue, TSelected = {}> extends BatcherOptions<TValue> {
5
+ export interface PreactBatcherOptions<TValue, TSelected = {}> extends BatcherOptions<TValue> {
6
6
  /**
7
7
  * Optional callback invoked when the component unmounts. Receives the batcher instance.
8
8
  * When provided, replaces the default cleanup (cancel); use it to call flush(), reset(), cancel(), add logging, etc.
9
9
  */
10
10
  onUnmount?: (batcher: PreactBatcher<TValue, TSelected>) => void;
11
11
  }
12
- interface PreactBatcher<TValue, TSelected = {}> extends Omit<Batcher<TValue>, 'store'> {
12
+ export interface PreactBatcher<TValue, TSelected = {}> extends Omit<Batcher<TValue>, 'store'> {
13
13
  /**
14
14
  * A Preact HOC (Higher Order Component) that allows you to subscribe to the batcher state.
15
15
  *
@@ -77,7 +77,6 @@ interface PreactBatcher<TValue, TSelected = {}> extends Omit<Batcher<TValue>, 's
77
77
  * - `executionCount`: Number of batch executions that have been completed
78
78
  * - `isEmpty`: Whether the batcher has no items to process
79
79
  * - `isPending`: Whether the batcher is waiting for the timeout to trigger batch processing
80
- * - `isRunning`: Whether the batcher is active and will process items automatically
81
80
  * - `items`: Array of items currently queued for batch processing
82
81
  * - `size`: Number of items currently in the batch queue
83
82
  * - `status`: Current processing status ('idle' | 'pending')
@@ -137,7 +136,6 @@ interface PreactBatcher<TValue, TSelected = {}> extends Omit<Batcher<TValue>, 's
137
136
  * { maxSize: 5, wait: 2000 },
138
137
  * (state) => ({
139
138
  * isPending: state.isPending,
140
- * isRunning: state.isRunning,
141
139
  * status: state.status
142
140
  * })
143
141
  * );
@@ -161,14 +159,12 @@ interface PreactBatcher<TValue, TSelected = {}> extends Omit<Batcher<TValue>, 's
161
159
  * batcher.addItem(3); // Triggers batch processing
162
160
  *
163
161
  * // Control the batcher
164
- * batcher.stop(); // Pause batching
165
- * batcher.start(); // Resume batching
162
+ * batcher.cancel(); // Cancel the pending timer; queued items are retained
163
+ * batcher.flush(); // Process queued items immediately
166
164
  *
167
165
  * // Access the selected state (will be empty object {} unless selector provided)
168
166
  * const { size, isPending } = batcher.state;
169
167
  * ```
170
168
  */
171
- declare function useBatcher<TValue, TSelected = {}>(fn: (items: Array<TValue>) => void, options?: PreactBatcherOptions<TValue, TSelected>, selector?: (state: BatcherState<TValue>) => TSelected): PreactBatcher<TValue, TSelected>;
172
- //#endregion
173
- export { PreactBatcher, PreactBatcherOptions, useBatcher };
174
- //# sourceMappingURL=useBatcher.d.ts.map
169
+ export declare function useBatcher<TValue, TSelected = {}>(fn: (items: Array<TValue>) => void, options?: PreactBatcherOptions<TValue, TSelected>, selector?: (state: BatcherState<TValue>) => TSelected): PreactBatcher<TValue, TSelected>;
170
+ //#endregion
@@ -41,7 +41,6 @@ import { Batcher } from "@tanstack/pacer/batcher";
41
41
  * - `executionCount`: Number of batch executions that have been completed
42
42
  * - `isEmpty`: Whether the batcher has no items to process
43
43
  * - `isPending`: Whether the batcher is waiting for the timeout to trigger batch processing
44
- * - `isRunning`: Whether the batcher is active and will process items automatically
45
44
  * - `items`: Array of items currently queued for batch processing
46
45
  * - `size`: Number of items currently in the batch queue
47
46
  * - `status`: Current processing status ('idle' | 'pending')
@@ -101,7 +100,6 @@ import { Batcher } from "@tanstack/pacer/batcher";
101
100
  * { maxSize: 5, wait: 2000 },
102
101
  * (state) => ({
103
102
  * isPending: state.isPending,
104
- * isRunning: state.isRunning,
105
103
  * status: state.status
106
104
  * })
107
105
  * );
@@ -125,8 +123,8 @@ import { Batcher } from "@tanstack/pacer/batcher";
125
123
  * batcher.addItem(3); // Triggers batch processing
126
124
  *
127
125
  * // Control the batcher
128
- * batcher.stop(); // Pause batching
129
- * batcher.start(); // Resume batching
126
+ * batcher.cancel(); // Cancel the pending timer; queued items are retained
127
+ * batcher.flush(); // Process queued items immediately
130
128
  *
131
129
  * // Access the selected state (will be empty object {} unless selector provided)
132
130
  * const { size, isPending } = batcher.state;
@@ -161,5 +159,4 @@ function useBatcher(fn, options = {}, selector = () => ({})) {
161
159
  }
162
160
 
163
161
  //#endregion
164
- export { useBatcher };
165
- //# sourceMappingURL=useBatcher.js.map
162
+ export { useBatcher };
@@ -37,7 +37,5 @@ import { AnyFunction } from "@tanstack/pacer/types";
37
37
  * />
38
38
  * ```
39
39
  */
40
- declare function useDebouncedCallback<TFn extends AnyFunction>(fn: TFn, options: PreactDebouncerOptions<TFn, {}>): (...args: Parameters<TFn>) => void;
41
- //#endregion
42
- export { useDebouncedCallback };
43
- //# sourceMappingURL=useDebouncedCallback.d.ts.map
40
+ export declare function useDebouncedCallback<TFn extends AnyFunction>(fn: TFn, options: PreactDebouncerOptions<TFn, {}>): (...args: Parameters<TFn>) => void;
41
+ //#endregion
@@ -44,5 +44,4 @@ function useDebouncedCallback(fn, options) {
44
44
  }
45
45
 
46
46
  //#endregion
47
- export { useDebouncedCallback };
48
- //# sourceMappingURL=useDebouncedCallback.js.map
47
+ export { useDebouncedCallback };
@@ -74,7 +74,5 @@ import { DebouncerState } from "@tanstack/pacer/debouncer";
74
74
  * const { isPending, executionCount } = debouncer.state;
75
75
  * ```
76
76
  */
77
- declare function useDebouncedState<TValue, TSelected = DebouncerState<Dispatch<StateUpdater<TValue>>>>(value: TValue, options: PreactDebouncerOptions<Dispatch<StateUpdater<TValue>>, TSelected>, selector?: (state: DebouncerState<Dispatch<StateUpdater<TValue>>>) => TSelected): [TValue, Dispatch<StateUpdater<TValue>>, PreactDebouncer<Dispatch<StateUpdater<TValue>>, TSelected>];
78
- //#endregion
79
- export { useDebouncedState };
80
- //# sourceMappingURL=useDebouncedState.d.ts.map
77
+ export declare function useDebouncedState<TValue, TSelected = DebouncerState<Dispatch<StateUpdater<TValue>>>>(value: TValue, options: PreactDebouncerOptions<Dispatch<StateUpdater<TValue>>, TSelected>, selector?: (state: DebouncerState<Dispatch<StateUpdater<TValue>>>) => TSelected): [TValue, Dispatch<StateUpdater<TValue>>, PreactDebouncer<Dispatch<StateUpdater<TValue>>, TSelected>];
78
+ //#endregion
@@ -85,5 +85,4 @@ function useDebouncedState(value, options, selector) {
85
85
  }
86
86
 
87
87
  //#endregion
88
- export { useDebouncedState };
89
- //# sourceMappingURL=useDebouncedState.js.map
88
+ export { useDebouncedState };
@@ -83,7 +83,5 @@ import { DebouncerState } from "@tanstack/pacer/debouncer";
83
83
  * const { isPending, executionCount } = debouncer.state;
84
84
  * ```
85
85
  */
86
- declare function useDebouncedValue<TValue, TSelected = DebouncerState<Dispatch<StateUpdater<TValue>>>>(value: TValue, options: PreactDebouncerOptions<Dispatch<StateUpdater<TValue>>, TSelected>, selector?: (state: DebouncerState<Dispatch<StateUpdater<TValue>>>) => TSelected): [TValue, PreactDebouncer<Dispatch<StateUpdater<TValue>>, TSelected>];
87
- //#endregion
88
- export { useDebouncedValue };
89
- //# sourceMappingURL=useDebouncedValue.d.ts.map
86
+ export declare function useDebouncedValue<TValue, TSelected = DebouncerState<Dispatch<StateUpdater<TValue>>>>(value: TValue, options: PreactDebouncerOptions<Dispatch<StateUpdater<TValue>>, TSelected>, selector?: (state: DebouncerState<Dispatch<StateUpdater<TValue>>>) => TSelected): [TValue, PreactDebouncer<Dispatch<StateUpdater<TValue>>, TSelected>];
87
+ //#endregion
@@ -92,5 +92,4 @@ function useDebouncedValue(value, options, selector) {
92
92
  }
93
93
 
94
94
  //#endregion
95
- export { useDebouncedValue };
96
- //# sourceMappingURL=useDebouncedValue.js.map
95
+ export { useDebouncedValue };
@@ -3,14 +3,14 @@ import { Store } from "@tanstack/preact-store";
3
3
  import { Debouncer, DebouncerOptions, DebouncerState } from "@tanstack/pacer/debouncer";
4
4
  import { AnyFunction } from "@tanstack/pacer/types";
5
5
  //#region src/debouncer/useDebouncer.d.ts
6
- interface PreactDebouncerOptions<TFn extends AnyFunction, TSelected = {}> extends DebouncerOptions<TFn> {
6
+ export interface PreactDebouncerOptions<TFn extends AnyFunction, TSelected = {}> extends DebouncerOptions<TFn> {
7
7
  /**
8
8
  * Optional callback invoked when the component unmounts. Receives the debouncer instance.
9
9
  * When provided, replaces the default cleanup (cancel); use it to call flush(), reset(), cancel(), add logging, etc.
10
10
  */
11
11
  onUnmount?: (debouncer: PreactDebouncer<TFn, TSelected>) => void;
12
12
  }
13
- interface PreactDebouncer<TFn extends AnyFunction, TSelected = {}> extends Omit<Debouncer<TFn>, 'store'> {
13
+ export interface PreactDebouncer<TFn extends AnyFunction, TSelected = {}> extends Omit<Debouncer<TFn>, 'store'> {
14
14
  /**
15
15
  * A Preact HOC (Higher Order Component) that allows you to subscribe to the debouncer state.
16
16
  *
@@ -145,7 +145,5 @@ interface PreactDebouncer<TFn extends AnyFunction, TSelected = {}> extends Omit<
145
145
  * const { isPending } = searchDebouncer.state;
146
146
  * ```
147
147
  */
148
- declare function useDebouncer<TFn extends AnyFunction, TSelected = {}>(fn: TFn, options: PreactDebouncerOptions<TFn, TSelected>, selector?: (state: DebouncerState<TFn>) => TSelected): PreactDebouncer<TFn, TSelected>;
149
- //#endregion
150
- export { PreactDebouncer, PreactDebouncerOptions, useDebouncer };
151
- //# sourceMappingURL=useDebouncer.d.ts.map
148
+ export declare function useDebouncer<TFn extends AnyFunction, TSelected = {}>(fn: TFn, options: PreactDebouncerOptions<TFn, TSelected>, selector?: (state: DebouncerState<TFn>) => TSelected): PreactDebouncer<TFn, TSelected>;
149
+ //#endregion
@@ -137,5 +137,4 @@ function useDebouncer(fn, options, selector = () => ({})) {
137
137
  }
138
138
 
139
139
  //#endregion
140
- export { useDebouncer };
141
- //# sourceMappingURL=useDebouncer.js.map
140
+ export { useDebouncer };
@@ -1,7 +1,7 @@
1
1
  import { AnyAsyncFunction, AnyFunction, AsyncBatcherOptions, AsyncDebouncerOptions, AsyncQueuerOptions, AsyncRateLimiterOptions, AsyncThrottlerOptions, BatcherOptions, DebouncerOptions, QueuerOptions, RateLimiterOptions, ThrottlerOptions } from "@tanstack/pacer";
2
2
  import { ComponentChildren } from "preact";
3
3
  //#region src/provider/PacerProvider.d.ts
4
- interface PacerProviderOptions {
4
+ export interface PacerProviderOptions {
5
5
  asyncBatcher?: Partial<AsyncBatcherOptions<any>>;
6
6
  asyncDebouncer?: Partial<AsyncDebouncerOptions<AnyAsyncFunction>>;
7
7
  asyncQueuer?: Partial<AsyncQueuerOptions<any>>;
@@ -16,13 +16,11 @@ interface PacerProviderOptions {
16
16
  interface PacerContextValue {
17
17
  defaultOptions: PacerProviderOptions;
18
18
  }
19
- interface PacerProviderProps {
19
+ export interface PacerProviderProps {
20
20
  children: ComponentChildren;
21
21
  defaultOptions?: PacerProviderOptions;
22
22
  }
23
- declare function PacerProvider({ children, defaultOptions }: PacerProviderProps): import("preact").JSX.Element;
24
- declare function usePacerContext(): PacerContextValue | null;
25
- declare function useDefaultPacerOptions(): PacerProviderOptions;
26
- //#endregion
27
- export { PacerProvider, PacerProviderOptions, PacerProviderProps, useDefaultPacerOptions, usePacerContext };
28
- //# sourceMappingURL=PacerProvider.d.ts.map
23
+ export declare function PacerProvider({ children, defaultOptions }: PacerProviderProps): import("preact").JSX.Element;
24
+ export declare function usePacerContext(): PacerContextValue | null;
25
+ export declare function useDefaultPacerOptions(): PacerProviderOptions;
26
+ //#endregion
@@ -20,5 +20,4 @@ function useDefaultPacerOptions() {
20
20
  }
21
21
 
22
22
  //#endregion
23
- export { PacerProvider, useDefaultPacerOptions, usePacerContext };
24
- //# sourceMappingURL=PacerProvider.js.map
23
+ export { PacerProvider, useDefaultPacerOptions, usePacerContext };
@@ -115,7 +115,5 @@ import { Queuer, QueuerState } from "@tanstack/pacer/queuer";
115
115
  * const { size, isRunning, executionCount } = queue.state;
116
116
  * ```
117
117
  */
118
- declare function useQueuedState<TValue, TSelected extends Pick<QueuerState<TValue>, 'items'> = Pick<QueuerState<TValue>, 'items'>>(fn: (item: TValue) => void, options?: PreactQueuerOptions<TValue, TSelected>, selector?: (state: QueuerState<TValue>) => TSelected): [Array<TValue>, Queuer<TValue>['addItem'], PreactQueuer<TValue, TSelected>];
119
- //#endregion
120
- export { useQueuedState };
121
- //# sourceMappingURL=useQueuedState.d.ts.map
118
+ export declare function useQueuedState<TValue, TSelected extends Pick<QueuerState<TValue>, 'items'> = Pick<QueuerState<TValue>, 'items'>>(fn: (item: TValue) => void, options?: PreactQueuerOptions<TValue, TSelected>, selector?: (state: QueuerState<TValue>) => TSelected): [Array<TValue>, Queuer<TValue>['addItem'], PreactQueuer<TValue, TSelected>];
119
+ //#endregion
@@ -125,5 +125,4 @@ function useQueuedState(fn, options = {}, selector) {
125
125
  }
126
126
 
127
127
  //#endregion
128
- export { useQueuedState };
129
- //# sourceMappingURL=useQueuedState.js.map
128
+ export { useQueuedState };