@tanstack/preact-pacer 0.22.1 → 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 (243) hide show
  1. package/README.md +17 -2
  2. package/dist/async-batcher/useAsyncBatchedCallback.d.ts +2 -5
  3. package/dist/async-batcher/useAsyncBatchedCallback.js +1 -2
  4. package/dist/async-batcher/useAsyncBatcher.d.ts +4 -8
  5. package/dist/async-batcher/useAsyncBatcher.js +1 -3
  6. package/dist/async-debouncer/useAsyncDebouncedCallback.d.ts +6 -7
  7. package/dist/async-debouncer/useAsyncDebouncedCallback.js +5 -4
  8. package/dist/async-debouncer/useAsyncDebouncer.d.ts +4 -7
  9. package/dist/async-debouncer/useAsyncDebouncer.js +1 -2
  10. package/dist/async-queuer/useAsyncQueuedState.d.ts +4 -7
  11. package/dist/async-queuer/useAsyncQueuedState.js +3 -4
  12. package/dist/async-queuer/useAsyncQueuer.d.ts +6 -9
  13. package/dist/async-queuer/useAsyncQueuer.js +3 -4
  14. package/dist/async-rate-limiter/useAsyncRateLimitedCallback.d.ts +2 -5
  15. package/dist/async-rate-limiter/useAsyncRateLimitedCallback.js +1 -2
  16. package/dist/async-rate-limiter/useAsyncRateLimiter.d.ts +4 -7
  17. package/dist/async-rate-limiter/useAsyncRateLimiter.js +1 -2
  18. package/dist/async-throttler/useAsyncThrottledCallback.d.ts +7 -9
  19. package/dist/async-throttler/useAsyncThrottledCallback.js +6 -6
  20. package/dist/async-throttler/useAsyncThrottler.d.ts +4 -7
  21. package/dist/async-throttler/useAsyncThrottler.js +1 -2
  22. package/dist/batcher/useBatchedCallback.d.ts +2 -5
  23. package/dist/batcher/useBatchedCallback.js +1 -2
  24. package/dist/batcher/useBatcher.d.ts +6 -11
  25. package/dist/batcher/useBatcher.js +3 -6
  26. package/dist/debouncer/useDebouncedCallback.d.ts +2 -5
  27. package/dist/debouncer/useDebouncedCallback.js +1 -2
  28. package/dist/debouncer/useDebouncedState.d.ts +2 -5
  29. package/dist/debouncer/useDebouncedState.js +1 -2
  30. package/dist/debouncer/useDebouncedValue.d.ts +2 -5
  31. package/dist/debouncer/useDebouncedValue.js +1 -2
  32. package/dist/debouncer/useDebouncer.d.ts +4 -7
  33. package/dist/debouncer/useDebouncer.js +1 -2
  34. package/dist/provider/PacerProvider.d.ts +6 -13
  35. package/dist/provider/PacerProvider.js +1 -2
  36. package/dist/queuer/useQueuedState.d.ts +2 -5
  37. package/dist/queuer/useQueuedState.js +1 -2
  38. package/dist/queuer/useQueuedValue.d.ts +2 -5
  39. package/dist/queuer/useQueuedValue.js +1 -2
  40. package/dist/queuer/useQueuer.d.ts +4 -7
  41. package/dist/queuer/useQueuer.js +1 -2
  42. package/dist/rate-limiter/useRateLimitedCallback.d.ts +2 -5
  43. package/dist/rate-limiter/useRateLimitedCallback.js +1 -2
  44. package/dist/rate-limiter/useRateLimitedState.d.ts +2 -5
  45. package/dist/rate-limiter/useRateLimitedState.js +1 -2
  46. package/dist/rate-limiter/useRateLimitedValue.d.ts +2 -5
  47. package/dist/rate-limiter/useRateLimitedValue.js +1 -2
  48. package/dist/rate-limiter/useRateLimiter.d.ts +4 -7
  49. package/dist/rate-limiter/useRateLimiter.js +1 -2
  50. package/dist/throttler/useThrottledCallback.d.ts +2 -5
  51. package/dist/throttler/useThrottledCallback.js +1 -2
  52. package/dist/throttler/useThrottledState.d.ts +2 -5
  53. package/dist/throttler/useThrottledState.js +1 -2
  54. package/dist/throttler/useThrottledValue.d.ts +2 -5
  55. package/dist/throttler/useThrottledValue.js +1 -2
  56. package/dist/throttler/useThrottler.d.ts +4 -7
  57. package/dist/throttler/useThrottler.js +1 -2
  58. package/package.json +24 -72
  59. package/dist/async-batcher/index.cjs +0 -13
  60. package/dist/async-batcher/index.d.cts +0 -4
  61. package/dist/async-batcher/useAsyncBatchedCallback.cjs +0 -51
  62. package/dist/async-batcher/useAsyncBatchedCallback.cjs.map +0 -1
  63. package/dist/async-batcher/useAsyncBatchedCallback.d.cts +0 -44
  64. package/dist/async-batcher/useAsyncBatchedCallback.js.map +0 -1
  65. package/dist/async-batcher/useAsyncBatcher.cjs +0 -217
  66. package/dist/async-batcher/useAsyncBatcher.cjs.map +0 -1
  67. package/dist/async-batcher/useAsyncBatcher.d.cts +0 -224
  68. package/dist/async-batcher/useAsyncBatcher.js.map +0 -1
  69. package/dist/async-debouncer/index.cjs +0 -13
  70. package/dist/async-debouncer/index.d.cts +0 -4
  71. package/dist/async-debouncer/useAsyncDebouncedCallback.cjs +0 -50
  72. package/dist/async-debouncer/useAsyncDebouncedCallback.cjs.map +0 -1
  73. package/dist/async-debouncer/useAsyncDebouncedCallback.d.cts +0 -46
  74. package/dist/async-debouncer/useAsyncDebouncedCallback.js.map +0 -1
  75. package/dist/async-debouncer/useAsyncDebouncer.cjs +0 -195
  76. package/dist/async-debouncer/useAsyncDebouncer.cjs.map +0 -1
  77. package/dist/async-debouncer/useAsyncDebouncer.d.cts +0 -203
  78. package/dist/async-debouncer/useAsyncDebouncer.js.map +0 -1
  79. package/dist/async-queuer/index.cjs +0 -13
  80. package/dist/async-queuer/index.d.cts +0 -4
  81. package/dist/async-queuer/useAsyncQueuedState.cjs +0 -154
  82. package/dist/async-queuer/useAsyncQueuedState.cjs.map +0 -1
  83. package/dist/async-queuer/useAsyncQueuedState.d.cts +0 -151
  84. package/dist/async-queuer/useAsyncQueuedState.js.map +0 -1
  85. package/dist/async-queuer/useAsyncQueuer.cjs +0 -217
  86. package/dist/async-queuer/useAsyncQueuer.cjs.map +0 -1
  87. package/dist/async-queuer/useAsyncQueuer.d.cts +0 -224
  88. package/dist/async-queuer/useAsyncQueuer.js.map +0 -1
  89. package/dist/async-rate-limiter/index.cjs +0 -13
  90. package/dist/async-rate-limiter/index.d.cts +0 -4
  91. package/dist/async-rate-limiter/useAsyncRateLimitedCallback.cjs +0 -65
  92. package/dist/async-rate-limiter/useAsyncRateLimitedCallback.cjs.map +0 -1
  93. package/dist/async-rate-limiter/useAsyncRateLimitedCallback.d.cts +0 -61
  94. package/dist/async-rate-limiter/useAsyncRateLimitedCallback.js.map +0 -1
  95. package/dist/async-rate-limiter/useAsyncRateLimiter.cjs +0 -209
  96. package/dist/async-rate-limiter/useAsyncRateLimiter.cjs.map +0 -1
  97. package/dist/async-rate-limiter/useAsyncRateLimiter.d.cts +0 -220
  98. package/dist/async-rate-limiter/useAsyncRateLimiter.js.map +0 -1
  99. package/dist/async-retryer/index.cjs +0 -9
  100. package/dist/async-retryer/index.d.cts +0 -1
  101. package/dist/async-throttler/index.cjs +0 -13
  102. package/dist/async-throttler/index.d.cts +0 -4
  103. package/dist/async-throttler/useAsyncThrottledCallback.cjs +0 -48
  104. package/dist/async-throttler/useAsyncThrottledCallback.cjs.map +0 -1
  105. package/dist/async-throttler/useAsyncThrottledCallback.d.cts +0 -44
  106. package/dist/async-throttler/useAsyncThrottledCallback.js.map +0 -1
  107. package/dist/async-throttler/useAsyncThrottler.cjs +0 -206
  108. package/dist/async-throttler/useAsyncThrottler.cjs.map +0 -1
  109. package/dist/async-throttler/useAsyncThrottler.d.cts +0 -214
  110. package/dist/async-throttler/useAsyncThrottler.js.map +0 -1
  111. package/dist/batcher/index.cjs +0 -13
  112. package/dist/batcher/index.d.cts +0 -4
  113. package/dist/batcher/useBatchedCallback.cjs +0 -47
  114. package/dist/batcher/useBatchedCallback.cjs.map +0 -1
  115. package/dist/batcher/useBatchedCallback.d.cts +0 -42
  116. package/dist/batcher/useBatchedCallback.js.map +0 -1
  117. package/dist/batcher/useBatcher.cjs +0 -165
  118. package/dist/batcher/useBatcher.cjs.map +0 -1
  119. package/dist/batcher/useBatcher.d.cts +0 -175
  120. package/dist/batcher/useBatcher.js.map +0 -1
  121. package/dist/debouncer/index.cjs +0 -17
  122. package/dist/debouncer/index.d.cts +0 -6
  123. package/dist/debouncer/useDebouncedCallback.cjs +0 -48
  124. package/dist/debouncer/useDebouncedCallback.cjs.map +0 -1
  125. package/dist/debouncer/useDebouncedCallback.d.cts +0 -44
  126. package/dist/debouncer/useDebouncedCallback.js.map +0 -1
  127. package/dist/debouncer/useDebouncedState.cjs +0 -89
  128. package/dist/debouncer/useDebouncedState.cjs.map +0 -1
  129. package/dist/debouncer/useDebouncedState.d.cts +0 -81
  130. package/dist/debouncer/useDebouncedState.js.map +0 -1
  131. package/dist/debouncer/useDebouncedValue.cjs +0 -96
  132. package/dist/debouncer/useDebouncedValue.cjs.map +0 -1
  133. package/dist/debouncer/useDebouncedValue.d.cts +0 -90
  134. package/dist/debouncer/useDebouncedValue.js.map +0 -1
  135. package/dist/debouncer/useDebouncer.cjs +0 -141
  136. package/dist/debouncer/useDebouncer.cjs.map +0 -1
  137. package/dist/debouncer/useDebouncer.d.cts +0 -152
  138. package/dist/debouncer/useDebouncer.js.map +0 -1
  139. package/dist/index.cjs +0 -67
  140. package/dist/index.d.cts +0 -30
  141. package/dist/provider/PacerProvider.cjs +0 -26
  142. package/dist/provider/PacerProvider.cjs.map +0 -1
  143. package/dist/provider/PacerProvider.d.cts +0 -33
  144. package/dist/provider/PacerProvider.js.map +0 -1
  145. package/dist/provider/index.cjs +0 -6
  146. package/dist/provider/index.d.cts +0 -2
  147. package/dist/queuer/index.cjs +0 -15
  148. package/dist/queuer/index.d.cts +0 -5
  149. package/dist/queuer/useQueuedState.cjs +0 -129
  150. package/dist/queuer/useQueuedState.cjs.map +0 -1
  151. package/dist/queuer/useQueuedState.d.cts +0 -122
  152. package/dist/queuer/useQueuedState.js.map +0 -1
  153. package/dist/queuer/useQueuedValue.cjs +0 -115
  154. package/dist/queuer/useQueuedValue.cjs.map +0 -1
  155. package/dist/queuer/useQueuedValue.d.cts +0 -105
  156. package/dist/queuer/useQueuedValue.js.map +0 -1
  157. package/dist/queuer/useQueuer.cjs +0 -176
  158. package/dist/queuer/useQueuer.cjs.map +0 -1
  159. package/dist/queuer/useQueuer.d.cts +0 -186
  160. package/dist/queuer/useQueuer.js.map +0 -1
  161. package/dist/rate-limiter/index.cjs +0 -17
  162. package/dist/rate-limiter/index.d.cts +0 -6
  163. package/dist/rate-limiter/useRateLimitedCallback.cjs +0 -65
  164. package/dist/rate-limiter/useRateLimitedCallback.cjs.map +0 -1
  165. package/dist/rate-limiter/useRateLimitedCallback.d.cts +0 -61
  166. package/dist/rate-limiter/useRateLimitedCallback.js.map +0 -1
  167. package/dist/rate-limiter/useRateLimitedState.cjs +0 -115
  168. package/dist/rate-limiter/useRateLimitedState.cjs.map +0 -1
  169. package/dist/rate-limiter/useRateLimitedState.d.cts +0 -107
  170. package/dist/rate-limiter/useRateLimitedState.js.map +0 -1
  171. package/dist/rate-limiter/useRateLimitedValue.cjs +0 -102
  172. package/dist/rate-limiter/useRateLimitedValue.cjs.map +0 -1
  173. package/dist/rate-limiter/useRateLimitedValue.d.cts +0 -96
  174. package/dist/rate-limiter/useRateLimitedValue.js.map +0 -1
  175. package/dist/rate-limiter/useRateLimiter.cjs +0 -167
  176. package/dist/rate-limiter/useRateLimiter.cjs.map +0 -1
  177. package/dist/rate-limiter/useRateLimiter.d.cts +0 -179
  178. package/dist/rate-limiter/useRateLimiter.js.map +0 -1
  179. package/dist/throttler/index.cjs +0 -17
  180. package/dist/throttler/index.d.cts +0 -6
  181. package/dist/throttler/useThrottledCallback.cjs +0 -49
  182. package/dist/throttler/useThrottledCallback.cjs.map +0 -1
  183. package/dist/throttler/useThrottledCallback.d.cts +0 -45
  184. package/dist/throttler/useThrottledCallback.js.map +0 -1
  185. package/dist/throttler/useThrottledState.cjs +0 -100
  186. package/dist/throttler/useThrottledState.cjs.map +0 -1
  187. package/dist/throttler/useThrottledState.d.cts +0 -92
  188. package/dist/throttler/useThrottledState.js.map +0 -1
  189. package/dist/throttler/useThrottledValue.cjs +0 -91
  190. package/dist/throttler/useThrottledValue.cjs.map +0 -1
  191. package/dist/throttler/useThrottledValue.d.cts +0 -85
  192. package/dist/throttler/useThrottledValue.js.map +0 -1
  193. package/dist/throttler/useThrottler.cjs +0 -146
  194. package/dist/throttler/useThrottler.cjs.map +0 -1
  195. package/dist/throttler/useThrottler.d.cts +0 -157
  196. package/dist/throttler/useThrottler.js.map +0 -1
  197. package/dist/types/index.cjs +0 -9
  198. package/dist/types/index.d.cts +0 -1
  199. package/dist/utils/index.cjs +0 -9
  200. package/dist/utils/index.d.cts +0 -1
  201. package/src/async-batcher/index.ts +0 -4
  202. package/src/async-batcher/useAsyncBatchedCallback.ts +0 -53
  203. package/src/async-batcher/useAsyncBatcher.ts +0 -293
  204. package/src/async-debouncer/index.ts +0 -5
  205. package/src/async-debouncer/useAsyncDebouncedCallback.ts +0 -54
  206. package/src/async-debouncer/useAsyncDebouncer.ts +0 -274
  207. package/src/async-queuer/index.ts +0 -4
  208. package/src/async-queuer/useAsyncQueuedState.ts +0 -165
  209. package/src/async-queuer/useAsyncQueuer.ts +0 -293
  210. package/src/async-rate-limiter/index.ts +0 -5
  211. package/src/async-rate-limiter/useAsyncRateLimitedCallback.ts +0 -69
  212. package/src/async-rate-limiter/useAsyncRateLimiter.ts +0 -294
  213. package/src/async-retryer/index.ts +0 -2
  214. package/src/async-throttler/index.ts +0 -5
  215. package/src/async-throttler/useAsyncThrottledCallback.ts +0 -52
  216. package/src/async-throttler/useAsyncThrottler.ts +0 -285
  217. package/src/batcher/index.ts +0 -4
  218. package/src/batcher/useBatchedCallback.ts +0 -46
  219. package/src/batcher/useBatcher.ts +0 -241
  220. package/src/debouncer/index.ts +0 -7
  221. package/src/debouncer/useDebouncedCallback.ts +0 -51
  222. package/src/debouncer/useDebouncedState.ts +0 -106
  223. package/src/debouncer/useDebouncedValue.ts +0 -109
  224. package/src/debouncer/useDebouncer.ts +0 -219
  225. package/src/index.ts +0 -56
  226. package/src/provider/PacerProvider.tsx +0 -70
  227. package/src/provider/index.ts +0 -1
  228. package/src/queuer/index.ts +0 -5
  229. package/src/queuer/useQueuedState.ts +0 -133
  230. package/src/queuer/useQueuedValue.ts +0 -129
  231. package/src/queuer/useQueuer.ts +0 -251
  232. package/src/rate-limiter/index.ts +0 -6
  233. package/src/rate-limiter/useRateLimitedCallback.ts +0 -68
  234. package/src/rate-limiter/useRateLimitedState.ts +0 -124
  235. package/src/rate-limiter/useRateLimitedValue.ts +0 -110
  236. package/src/rate-limiter/useRateLimiter.ts +0 -244
  237. package/src/throttler/index.ts +0 -7
  238. package/src/throttler/useThrottledCallback.ts +0 -52
  239. package/src/throttler/useThrottledState.ts +0 -118
  240. package/src/throttler/useThrottledValue.ts +0 -104
  241. package/src/throttler/useThrottler.ts +0 -224
  242. package/src/types/index.ts +0 -1
  243. package/src/utils/index.ts +0 -1
@@ -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 };
@@ -1,7 +1,6 @@
1
1
  import { PreactDebouncer, PreactDebouncerOptions } from "./useDebouncer.js";
2
2
  import { Dispatch, StateUpdater } from "preact/hooks";
3
3
  import { DebouncerState } from "@tanstack/pacer/debouncer";
4
-
5
4
  //#region src/debouncer/useDebouncedState.d.ts
6
5
  /**
7
6
  * A Preact hook that creates a debounced state value, combining Preact's useState with debouncing functionality.
@@ -75,7 +74,5 @@ import { DebouncerState } from "@tanstack/pacer/debouncer";
75
74
  * const { isPending, executionCount } = debouncer.state;
76
75
  * ```
77
76
  */
78
- 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>];
79
- //#endregion
80
- export { useDebouncedState };
81
- //# 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 };
@@ -1,7 +1,6 @@
1
1
  import { PreactDebouncer, PreactDebouncerOptions } from "./useDebouncer.js";
2
2
  import { Dispatch, StateUpdater } from "preact/hooks";
3
3
  import { DebouncerState } from "@tanstack/pacer/debouncer";
4
-
5
4
  //#region src/debouncer/useDebouncedValue.d.ts
6
5
  /**
7
6
  * A Preact hook that creates a debounced value that updates only after a specified delay.
@@ -84,7 +83,5 @@ import { DebouncerState } from "@tanstack/pacer/debouncer";
84
83
  * const { isPending, executionCount } = debouncer.state;
85
84
  * ```
86
85
  */
87
- 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>];
88
- //#endregion
89
- export { useDebouncedValue };
90
- //# 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 };
@@ -2,16 +2,15 @@ import { ComponentChildren } from "preact";
2
2
  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
-
6
5
  //#region src/debouncer/useDebouncer.d.ts
7
- interface PreactDebouncerOptions<TFn extends AnyFunction, TSelected = {}> extends DebouncerOptions<TFn> {
6
+ export interface PreactDebouncerOptions<TFn extends AnyFunction, TSelected = {}> extends DebouncerOptions<TFn> {
8
7
  /**
9
8
  * Optional callback invoked when the component unmounts. Receives the debouncer instance.
10
9
  * When provided, replaces the default cleanup (cancel); use it to call flush(), reset(), cancel(), add logging, etc.
11
10
  */
12
11
  onUnmount?: (debouncer: PreactDebouncer<TFn, TSelected>) => void;
13
12
  }
14
- interface PreactDebouncer<TFn extends AnyFunction, TSelected = {}> extends Omit<Debouncer<TFn>, 'store'> {
13
+ export interface PreactDebouncer<TFn extends AnyFunction, TSelected = {}> extends Omit<Debouncer<TFn>, 'store'> {
15
14
  /**
16
15
  * A Preact HOC (Higher Order Component) that allows you to subscribe to the debouncer state.
17
16
  *
@@ -146,7 +145,5 @@ interface PreactDebouncer<TFn extends AnyFunction, TSelected = {}> extends Omit<
146
145
  * const { isPending } = searchDebouncer.state;
147
146
  * ```
148
147
  */
149
- declare function useDebouncer<TFn extends AnyFunction, TSelected = {}>(fn: TFn, options: PreactDebouncerOptions<TFn, TSelected>, selector?: (state: DebouncerState<TFn>) => TSelected): PreactDebouncer<TFn, TSelected>;
150
- //#endregion
151
- export { PreactDebouncer, PreactDebouncerOptions, useDebouncer };
152
- //# 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,9 +1,7 @@
1
1
  import { AnyAsyncFunction, AnyFunction, AsyncBatcherOptions, AsyncDebouncerOptions, AsyncQueuerOptions, AsyncRateLimiterOptions, AsyncThrottlerOptions, BatcherOptions, DebouncerOptions, QueuerOptions, RateLimiterOptions, ThrottlerOptions } from "@tanstack/pacer";
2
- import * as _$preact from "preact";
3
2
  import { ComponentChildren } from "preact";
4
-
5
3
  //#region src/provider/PacerProvider.d.ts
6
- interface PacerProviderOptions {
4
+ export interface PacerProviderOptions {
7
5
  asyncBatcher?: Partial<AsyncBatcherOptions<any>>;
8
6
  asyncDebouncer?: Partial<AsyncDebouncerOptions<AnyAsyncFunction>>;
9
7
  asyncQueuer?: Partial<AsyncQueuerOptions<any>>;
@@ -18,16 +16,11 @@ interface PacerProviderOptions {
18
16
  interface PacerContextValue {
19
17
  defaultOptions: PacerProviderOptions;
20
18
  }
21
- interface PacerProviderProps {
19
+ export interface PacerProviderProps {
22
20
  children: ComponentChildren;
23
21
  defaultOptions?: PacerProviderOptions;
24
22
  }
25
- declare function PacerProvider({
26
- children,
27
- defaultOptions
28
- }: PacerProviderProps): _$preact.JSX.Element;
29
- declare function usePacerContext(): PacerContextValue | null;
30
- declare function useDefaultPacerOptions(): PacerProviderOptions;
31
- //#endregion
32
- export { PacerProvider, PacerProviderOptions, PacerProviderProps, useDefaultPacerOptions, usePacerContext };
33
- //# 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 };
@@ -1,6 +1,5 @@
1
1
  import { PreactQueuer, PreactQueuerOptions } from "./useQueuer.js";
2
2
  import { Queuer, QueuerState } from "@tanstack/pacer/queuer";
3
-
4
3
  //#region src/queuer/useQueuedState.d.ts
5
4
  /**
6
5
  * A Preact hook that creates a queuer with managed state, combining Preact's useState with queuing functionality.
@@ -116,7 +115,5 @@ import { Queuer, QueuerState } from "@tanstack/pacer/queuer";
116
115
  * const { size, isRunning, executionCount } = queue.state;
117
116
  * ```
118
117
  */
119
- 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>];
120
- //#endregion
121
- export { useQueuedState };
122
- //# 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 };
@@ -1,6 +1,5 @@
1
1
  import { PreactQueuer, PreactQueuerOptions } from "./useQueuer.js";
2
2
  import { QueuerState } from "@tanstack/pacer/queuer";
3
-
4
3
  //#region src/queuer/useQueuedValue.d.ts
5
4
  /**
6
5
  * A Preact hook that creates a queued value that processes state changes in order with an optional delay.
@@ -99,7 +98,5 @@ import { QueuerState } from "@tanstack/pacer/queuer";
99
98
  * const { size, isRunning, executionCount } = queuer.state;
100
99
  * ```
101
100
  */
102
- declare function useQueuedValue<TValue, TSelected extends Pick<QueuerState<TValue>, 'items'> = Pick<QueuerState<TValue>, 'items'>>(initialValue: TValue, options?: PreactQueuerOptions<TValue, TSelected>, selector?: (state: QueuerState<TValue>) => TSelected): [TValue, PreactQueuer<TValue, TSelected>];
103
- //#endregion
104
- export { useQueuedValue };
105
- //# sourceMappingURL=useQueuedValue.d.ts.map
101
+ export declare function useQueuedValue<TValue, TSelected extends Pick<QueuerState<TValue>, 'items'> = Pick<QueuerState<TValue>, 'items'>>(initialValue: TValue, options?: PreactQueuerOptions<TValue, TSelected>, selector?: (state: QueuerState<TValue>) => TSelected): [TValue, PreactQueuer<TValue, TSelected>];
102
+ //#endregion
@@ -111,5 +111,4 @@ function useQueuedValue(initialValue, options = {}, selector) {
111
111
  }
112
112
 
113
113
  //#endregion
114
- export { useQueuedValue };
115
- //# sourceMappingURL=useQueuedValue.js.map
114
+ export { useQueuedValue };
@@ -1,16 +1,15 @@
1
1
  import { ComponentChildren } from "preact";
2
2
  import { Store } from "@tanstack/preact-store";
3
3
  import { Queuer, QueuerOptions, QueuerState } from "@tanstack/pacer/queuer";
4
-
5
4
  //#region src/queuer/useQueuer.d.ts
6
- interface PreactQueuerOptions<TValue, TSelected = {}> extends QueuerOptions<TValue> {
5
+ export interface PreactQueuerOptions<TValue, TSelected = {}> extends QueuerOptions<TValue> {
7
6
  /**
8
7
  * Optional callback invoked when the component unmounts. Receives the queuer instance.
9
8
  * When provided, replaces the default cleanup (stop); use it to call flush(), flushAsBatch(), stop(), add logging, etc.
10
9
  */
11
10
  onUnmount?: (queuer: PreactQueuer<TValue, TSelected>) => void;
12
11
  }
13
- interface PreactQueuer<TValue, TSelected = {}> extends Omit<Queuer<TValue>, 'store'> {
12
+ export interface PreactQueuer<TValue, TSelected = {}> extends Omit<Queuer<TValue>, 'store'> {
14
13
  /**
15
14
  * A Preact HOC (Higher Order Component) that allows you to subscribe to the queuer state.
16
15
  *
@@ -180,7 +179,5 @@ interface PreactQueuer<TValue, TSelected = {}> extends Omit<Queuer<TValue>, 'sto
180
179
  * const { size, isRunning, executionCount } = queue.state;
181
180
  * ```
182
181
  */
183
- declare function useQueuer<TValue, TSelected = {}>(fn: (item: TValue) => void, options?: PreactQueuerOptions<TValue, TSelected>, selector?: (state: QueuerState<TValue>) => TSelected): PreactQueuer<TValue, TSelected>;
184
- //#endregion
185
- export { PreactQueuer, PreactQueuerOptions, useQueuer };
186
- //# sourceMappingURL=useQueuer.d.ts.map
182
+ export declare function useQueuer<TValue, TSelected = {}>(fn: (item: TValue) => void, options?: PreactQueuerOptions<TValue, TSelected>, selector?: (state: QueuerState<TValue>) => TSelected): PreactQueuer<TValue, TSelected>;
183
+ //#endregion
@@ -172,5 +172,4 @@ function useQueuer(fn, options = {}, selector = () => ({})) {
172
172
  }
173
173
 
174
174
  //#endregion
175
- export { useQueuer };
176
- //# sourceMappingURL=useQueuer.js.map
175
+ export { useQueuer };
@@ -1,6 +1,5 @@
1
1
  import { PreactRateLimiterOptions } from "./useRateLimiter.js";
2
2
  import { AnyFunction } from "@tanstack/pacer/types";
3
-
4
3
  //#region src/rate-limiter/useRateLimitedCallback.d.ts
5
4
  /**
6
5
  * A Preact hook that creates a rate-limited version of a callback function.
@@ -55,7 +54,5 @@ import { AnyFunction } from "@tanstack/pacer/types";
55
54
  * );
56
55
  * ```
57
56
  */
58
- declare function useRateLimitedCallback<TFn extends AnyFunction>(fn: TFn, options: PreactRateLimiterOptions<TFn, {}>): (...args: Parameters<TFn>) => boolean;
59
- //#endregion
60
- export { useRateLimitedCallback };
61
- //# sourceMappingURL=useRateLimitedCallback.d.ts.map
57
+ export declare function useRateLimitedCallback<TFn extends AnyFunction>(fn: TFn, options: PreactRateLimiterOptions<TFn, {}>): (...args: Parameters<TFn>) => boolean;
58
+ //#endregion
@@ -61,5 +61,4 @@ function useRateLimitedCallback(fn, options) {
61
61
  }
62
62
 
63
63
  //#endregion
64
- export { useRateLimitedCallback };
65
- //# sourceMappingURL=useRateLimitedCallback.js.map
64
+ export { useRateLimitedCallback };
@@ -1,7 +1,6 @@
1
1
  import { PreactRateLimiter, PreactRateLimiterOptions } from "./useRateLimiter.js";
2
2
  import { Dispatch, StateUpdater } from "preact/hooks";
3
3
  import { RateLimiterState } from "@tanstack/pacer/rate-limiter";
4
-
5
4
  //#region src/rate-limiter/useRateLimitedState.d.ts
6
5
  /**
7
6
  * A Preact hook that creates a rate-limited state value that enforces a hard limit on state updates within a time window.
@@ -101,7 +100,5 @@ import { RateLimiterState } from "@tanstack/pacer/rate-limiter";
101
100
  * const { executionCount, rejectionCount } = rateLimiter.state;
102
101
  * ```
103
102
  */
104
- declare function useRateLimitedState<TValue, TSelected = RateLimiterState>(value: TValue, options: PreactRateLimiterOptions<Dispatch<StateUpdater<TValue>>, TSelected>, selector?: (state: RateLimiterState) => TSelected): [TValue, Dispatch<StateUpdater<TValue>>, PreactRateLimiter<Dispatch<StateUpdater<TValue>>, TSelected>];
105
- //#endregion
106
- export { useRateLimitedState };
107
- //# sourceMappingURL=useRateLimitedState.d.ts.map
103
+ export declare function useRateLimitedState<TValue, TSelected = RateLimiterState>(value: TValue, options: PreactRateLimiterOptions<Dispatch<StateUpdater<TValue>>, TSelected>, selector?: (state: RateLimiterState) => TSelected): [TValue, Dispatch<StateUpdater<TValue>>, PreactRateLimiter<Dispatch<StateUpdater<TValue>>, TSelected>];
104
+ //#endregion
@@ -111,5 +111,4 @@ function useRateLimitedState(value, options, selector) {
111
111
  }
112
112
 
113
113
  //#endregion
114
- export { useRateLimitedState };
115
- //# sourceMappingURL=useRateLimitedState.js.map
114
+ export { useRateLimitedState };
@@ -1,7 +1,6 @@
1
1
  import { PreactRateLimiter, PreactRateLimiterOptions } from "./useRateLimiter.js";
2
2
  import { Dispatch, StateUpdater } from "preact/hooks";
3
3
  import { RateLimiterState } from "@tanstack/pacer/rate-limiter";
4
-
5
4
  //#region src/rate-limiter/useRateLimitedValue.d.ts
6
5
  /**
7
6
  * A high-level Preact hook that creates a rate-limited version of a value that updates at most a certain number of times within a time window.
@@ -90,7 +89,5 @@ import { RateLimiterState } from "@tanstack/pacer/rate-limiter";
90
89
  * const { executionCount, rejectionCount } = rateLimiter.state;
91
90
  * ```
92
91
  */
93
- declare function useRateLimitedValue<TValue, TSelected = RateLimiterState>(value: TValue, options: PreactRateLimiterOptions<Dispatch<StateUpdater<TValue>>, TSelected>, selector?: (state: RateLimiterState) => TSelected): [TValue, PreactRateLimiter<Dispatch<StateUpdater<TValue>>, TSelected>];
94
- //#endregion
95
- export { useRateLimitedValue };
96
- //# sourceMappingURL=useRateLimitedValue.d.ts.map
92
+ export declare function useRateLimitedValue<TValue, TSelected = RateLimiterState>(value: TValue, options: PreactRateLimiterOptions<Dispatch<StateUpdater<TValue>>, TSelected>, selector?: (state: RateLimiterState) => TSelected): [TValue, PreactRateLimiter<Dispatch<StateUpdater<TValue>>, TSelected>];
93
+ //#endregion
@@ -98,5 +98,4 @@ function useRateLimitedValue(value, options, selector) {
98
98
  }
99
99
 
100
100
  //#endregion
101
- export { useRateLimitedValue };
102
- //# sourceMappingURL=useRateLimitedValue.js.map
101
+ export { useRateLimitedValue };
@@ -2,16 +2,15 @@ import { ComponentChildren } from "preact";
2
2
  import { Store } from "@tanstack/preact-store";
3
3
  import { RateLimiter, RateLimiterOptions, RateLimiterState } from "@tanstack/pacer/rate-limiter";
4
4
  import { AnyFunction } from "@tanstack/pacer/types";
5
-
6
5
  //#region src/rate-limiter/useRateLimiter.d.ts
7
- interface PreactRateLimiterOptions<TFn extends AnyFunction, TSelected = {}> extends RateLimiterOptions<TFn> {
6
+ export interface PreactRateLimiterOptions<TFn extends AnyFunction, TSelected = {}> extends RateLimiterOptions<TFn> {
8
7
  /**
9
8
  * Optional callback invoked when the component unmounts. Receives the rate limiter instance.
10
9
  * When provided, replaces the default cleanup; use it to call reset(), add logging, etc.
11
10
  */
12
11
  onUnmount?: (rateLimiter: PreactRateLimiter<TFn, TSelected>) => void;
13
12
  }
14
- interface PreactRateLimiter<TFn extends AnyFunction, TSelected = {}> extends Omit<RateLimiter<TFn>, 'store'> {
13
+ export interface PreactRateLimiter<TFn extends AnyFunction, TSelected = {}> extends Omit<RateLimiter<TFn>, 'store'> {
15
14
  /**
16
15
  * A Preact HOC (Higher Order Component) that allows you to subscribe to the rate limiter state.
17
16
  *
@@ -173,7 +172,5 @@ interface PreactRateLimiter<TFn extends AnyFunction, TSelected = {}> extends Omi
173
172
  * const { executionCount, rejectionCount } = rateLimiter.state;
174
173
  * ```
175
174
  */
176
- declare function useRateLimiter<TFn extends AnyFunction, TSelected = {}>(fn: TFn, options: PreactRateLimiterOptions<TFn, TSelected>, selector?: (state: RateLimiterState) => TSelected): PreactRateLimiter<TFn, TSelected>;
177
- //#endregion
178
- export { PreactRateLimiter, PreactRateLimiterOptions, useRateLimiter };
179
- //# sourceMappingURL=useRateLimiter.d.ts.map
175
+ export declare function useRateLimiter<TFn extends AnyFunction, TSelected = {}>(fn: TFn, options: PreactRateLimiterOptions<TFn, TSelected>, selector?: (state: RateLimiterState) => TSelected): PreactRateLimiter<TFn, TSelected>;
176
+ //#endregion
@@ -163,5 +163,4 @@ function useRateLimiter(fn, options, selector = () => ({})) {
163
163
  }
164
164
 
165
165
  //#endregion
166
- export { useRateLimiter };
167
- //# sourceMappingURL=useRateLimiter.js.map
166
+ export { useRateLimiter };
@@ -1,6 +1,5 @@
1
1
  import { PreactThrottlerOptions } from "./useThrottler.js";
2
2
  import { AnyFunction } from "@tanstack/pacer/types";
3
-
4
3
  //#region src/throttler/useThrottledCallback.d.ts
5
4
  /**
6
5
  * A Preact hook that creates a throttled version of a callback function.
@@ -39,7 +38,5 @@ import { AnyFunction } from "@tanstack/pacer/types";
39
38
  * }, [handleResize]);
40
39
  * ```
41
40
  */
42
- declare function useThrottledCallback<TFn extends AnyFunction>(fn: TFn, options: PreactThrottlerOptions<TFn, {}>): (...args: Parameters<TFn>) => void;
43
- //#endregion
44
- export { useThrottledCallback };
45
- //# sourceMappingURL=useThrottledCallback.d.ts.map
41
+ export declare function useThrottledCallback<TFn extends AnyFunction>(fn: TFn, options: PreactThrottlerOptions<TFn, {}>): (...args: Parameters<TFn>) => void;
42
+ //#endregion
@@ -45,5 +45,4 @@ function useThrottledCallback(fn, options) {
45
45
  }
46
46
 
47
47
  //#endregion
48
- export { useThrottledCallback };
49
- //# sourceMappingURL=useThrottledCallback.js.map
48
+ export { useThrottledCallback };
@@ -1,7 +1,6 @@
1
1
  import { PreactThrottler, PreactThrottlerOptions } from "./useThrottler.js";
2
2
  import { Dispatch, StateUpdater } from "preact/hooks";
3
3
  import { ThrottlerState } from "@tanstack/pacer/throttler";
4
-
5
4
  //#region src/throttler/useThrottledState.d.ts
6
5
  /**
7
6
  * A Preact hook that creates a throttled state value that updates at most once within a specified time window.
@@ -86,7 +85,5 @@ import { ThrottlerState } from "@tanstack/pacer/throttler";
86
85
  * const { executionCount, isPending } = throttler.state;
87
86
  * ```
88
87
  */
89
- declare function useThrottledState<TValue, TSelected = ThrottlerState<Dispatch<StateUpdater<TValue>>>>(value: TValue, options: PreactThrottlerOptions<Dispatch<StateUpdater<TValue>>, TSelected>, selector?: (state: ThrottlerState<Dispatch<StateUpdater<TValue>>>) => TSelected): [TValue, Dispatch<StateUpdater<TValue>>, PreactThrottler<Dispatch<StateUpdater<TValue>>, TSelected>];
90
- //#endregion
91
- export { useThrottledState };
92
- //# sourceMappingURL=useThrottledState.d.ts.map
88
+ export declare function useThrottledState<TValue, TSelected = ThrottlerState<Dispatch<StateUpdater<TValue>>>>(value: TValue, options: PreactThrottlerOptions<Dispatch<StateUpdater<TValue>>, TSelected>, selector?: (state: ThrottlerState<Dispatch<StateUpdater<TValue>>>) => TSelected): [TValue, Dispatch<StateUpdater<TValue>>, PreactThrottler<Dispatch<StateUpdater<TValue>>, TSelected>];
89
+ //#endregion
@@ -96,5 +96,4 @@ function useThrottledState(value, options, selector) {
96
96
  }
97
97
 
98
98
  //#endregion
99
- export { useThrottledState };
100
- //# sourceMappingURL=useThrottledState.js.map
99
+ export { useThrottledState };
@@ -1,7 +1,6 @@
1
1
  import { PreactThrottler, PreactThrottlerOptions } from "./useThrottler.js";
2
2
  import { Dispatch, StateUpdater } from "preact/hooks";
3
3
  import { ThrottlerState } from "@tanstack/pacer/throttler";
4
-
5
4
  //#region src/throttler/useThrottledValue.d.ts
6
5
  /**
7
6
  * A high-level Preact hook that creates a throttled version of a value that updates at most once within a specified time window.
@@ -79,7 +78,5 @@ import { ThrottlerState } from "@tanstack/pacer/throttler";
79
78
  * const { executionCount, isPending } = throttler.state;
80
79
  * ```
81
80
  */
82
- declare function useThrottledValue<TValue, TSelected = ThrottlerState<Dispatch<StateUpdater<TValue>>>>(value: TValue, options: PreactThrottlerOptions<Dispatch<StateUpdater<TValue>>, TSelected>, selector?: (state: ThrottlerState<Dispatch<StateUpdater<TValue>>>) => TSelected): [TValue, PreactThrottler<Dispatch<StateUpdater<TValue>>, TSelected>];
83
- //#endregion
84
- export { useThrottledValue };
85
- //# sourceMappingURL=useThrottledValue.d.ts.map
81
+ export declare function useThrottledValue<TValue, TSelected = ThrottlerState<Dispatch<StateUpdater<TValue>>>>(value: TValue, options: PreactThrottlerOptions<Dispatch<StateUpdater<TValue>>, TSelected>, selector?: (state: ThrottlerState<Dispatch<StateUpdater<TValue>>>) => TSelected): [TValue, PreactThrottler<Dispatch<StateUpdater<TValue>>, TSelected>];
82
+ //#endregion
@@ -87,5 +87,4 @@ function useThrottledValue(value, options, selector) {
87
87
  }
88
88
 
89
89
  //#endregion
90
- export { useThrottledValue };
91
- //# sourceMappingURL=useThrottledValue.js.map
90
+ export { useThrottledValue };
@@ -2,16 +2,15 @@ import { ComponentChildren } from "preact";
2
2
  import { Store } from "@tanstack/preact-store";
3
3
  import { Throttler, ThrottlerOptions, ThrottlerState } from "@tanstack/pacer/throttler";
4
4
  import { AnyFunction } from "@tanstack/pacer/types";
5
-
6
5
  //#region src/throttler/useThrottler.d.ts
7
- interface PreactThrottlerOptions<TFn extends AnyFunction, TSelected = {}> extends ThrottlerOptions<TFn> {
6
+ export interface PreactThrottlerOptions<TFn extends AnyFunction, TSelected = {}> extends ThrottlerOptions<TFn> {
8
7
  /**
9
8
  * Optional callback invoked when the component unmounts. Receives the throttler instance.
10
9
  * When provided, replaces the default cleanup (cancel); use it to call flush(), reset(), cancel(), add logging, etc.
11
10
  */
12
11
  onUnmount?: (throttler: PreactThrottler<TFn, TSelected>) => void;
13
12
  }
14
- interface PreactThrottler<TFn extends AnyFunction, TSelected = {}> extends Omit<Throttler<TFn>, 'store'> {
13
+ export interface PreactThrottler<TFn extends AnyFunction, TSelected = {}> extends Omit<Throttler<TFn>, 'store'> {
15
14
  /**
16
15
  * A Preact HOC (Higher Order Component) that allows you to subscribe to the throttler state.
17
16
  *
@@ -151,7 +150,5 @@ interface PreactThrottler<TFn extends AnyFunction, TSelected = {}> extends Omit<
151
150
  * const { executionCount, isPending } = throttler.state;
152
151
  * ```
153
152
  */
154
- declare function useThrottler<TFn extends AnyFunction, TSelected = {}>(fn: TFn, options: PreactThrottlerOptions<TFn, TSelected>, selector?: (state: ThrottlerState<TFn>) => TSelected): PreactThrottler<TFn, TSelected>;
155
- //#endregion
156
- export { PreactThrottler, PreactThrottlerOptions, useThrottler };
157
- //# sourceMappingURL=useThrottler.d.ts.map
153
+ export declare function useThrottler<TFn extends AnyFunction, TSelected = {}>(fn: TFn, options: PreactThrottlerOptions<TFn, TSelected>, selector?: (state: ThrottlerState<TFn>) => TSelected): PreactThrottler<TFn, TSelected>;
154
+ //#endregion
@@ -142,5 +142,4 @@ function useThrottler(fn, options, selector = () => ({})) {
142
142
  }
143
143
 
144
144
  //#endregion
145
- export { useThrottler };
146
- //# sourceMappingURL=useThrottler.js.map
145
+ export { useThrottler };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/preact-pacer",
3
- "version": "0.22.1",
3
+ "version": "0.24.0",
4
4
  "description": "Utilities for debouncing and throttling functions in Preact.",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -23,88 +23,40 @@
23
23
  "async"
24
24
  ],
25
25
  "type": "module",
26
- "types": "./dist/index.d.cts",
27
- "main": "./dist/index.cjs",
28
- "module": "./dist/index.js",
26
+ "types": "./dist/index.d.ts",
29
27
  "exports": {
30
- ".": {
31
- "import": "./dist/index.js",
32
- "require": "./dist/index.cjs"
33
- },
34
- "./async-batcher": {
35
- "import": "./dist/async-batcher/index.js",
36
- "require": "./dist/async-batcher/index.cjs"
37
- },
38
- "./async-debouncer": {
39
- "import": "./dist/async-debouncer/index.js",
40
- "require": "./dist/async-debouncer/index.cjs"
41
- },
42
- "./async-queuer": {
43
- "import": "./dist/async-queuer/index.js",
44
- "require": "./dist/async-queuer/index.cjs"
45
- },
46
- "./async-rate-limiter": {
47
- "import": "./dist/async-rate-limiter/index.js",
48
- "require": "./dist/async-rate-limiter/index.cjs"
49
- },
50
- "./async-retryer": {
51
- "import": "./dist/async-retryer/index.js",
52
- "require": "./dist/async-retryer/index.cjs"
53
- },
54
- "./async-throttler": {
55
- "import": "./dist/async-throttler/index.js",
56
- "require": "./dist/async-throttler/index.cjs"
57
- },
58
- "./batcher": {
59
- "import": "./dist/batcher/index.js",
60
- "require": "./dist/batcher/index.cjs"
61
- },
62
- "./debouncer": {
63
- "import": "./dist/debouncer/index.js",
64
- "require": "./dist/debouncer/index.cjs"
65
- },
66
- "./provider": {
67
- "import": "./dist/provider/index.js",
68
- "require": "./dist/provider/index.cjs"
69
- },
70
- "./queuer": {
71
- "import": "./dist/queuer/index.js",
72
- "require": "./dist/queuer/index.cjs"
73
- },
74
- "./rate-limiter": {
75
- "import": "./dist/rate-limiter/index.js",
76
- "require": "./dist/rate-limiter/index.cjs"
77
- },
78
- "./throttler": {
79
- "import": "./dist/throttler/index.js",
80
- "require": "./dist/throttler/index.cjs"
81
- },
82
- "./types": {
83
- "import": "./dist/types/index.js",
84
- "require": "./dist/types/index.cjs"
85
- },
86
- "./utils": {
87
- "import": "./dist/utils/index.js",
88
- "require": "./dist/utils/index.cjs"
89
- },
28
+ ".": "./dist/index.js",
29
+ "./async-batcher": "./dist/async-batcher/index.js",
30
+ "./async-debouncer": "./dist/async-debouncer/index.js",
31
+ "./async-queuer": "./dist/async-queuer/index.js",
32
+ "./async-rate-limiter": "./dist/async-rate-limiter/index.js",
33
+ "./async-retryer": "./dist/async-retryer/index.js",
34
+ "./async-throttler": "./dist/async-throttler/index.js",
35
+ "./batcher": "./dist/batcher/index.js",
36
+ "./debouncer": "./dist/debouncer/index.js",
37
+ "./provider": "./dist/provider/index.js",
38
+ "./queuer": "./dist/queuer/index.js",
39
+ "./rate-limiter": "./dist/rate-limiter/index.js",
40
+ "./throttler": "./dist/throttler/index.js",
41
+ "./types": "./dist/types/index.js",
42
+ "./utils": "./dist/utils/index.js",
90
43
  "./package.json": "./package.json"
91
44
  },
92
45
  "sideEffects": false,
93
46
  "engines": {
94
- "node": ">=18"
47
+ "node": ">=20"
95
48
  },
96
49
  "files": [
97
- "dist",
98
- "src"
50
+ "dist"
99
51
  ],
100
52
  "dependencies": {
101
- "@tanstack/preact-store": "^0.13.1",
102
- "@tanstack/pacer": "0.21.1"
53
+ "@tanstack/pacer": "0.23.0",
54
+ "@tanstack/preact-store": "^0.13.3"
103
55
  },
104
56
  "devDependencies": {
105
- "@preact/preset-vite": "^2.10.5",
57
+ "@preact/preset-vite": "^2.10.6",
106
58
  "eslint-plugin-react-hooks": "^7.1.1",
107
- "preact": "^10.29.1"
59
+ "preact": "^10.29.8"
108
60
  },
109
61
  "peerDependencies": {
110
62
  "preact": ">=10.0.0"
@@ -116,7 +68,7 @@
116
68
  "test:lib": "vitest --passWithNoTests",
117
69
  "test:lib:dev": "pnpm test:lib --watch",
118
70
  "test:types": "tsc",
119
- "test:build": "publint --strict",
71
+ "test:build": "publint --strict && node ../../scripts/verify-package.ts",
120
72
  "build": "tsdown"
121
73
  }
122
74
  }
@@ -1,13 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_useAsyncBatcher = require('./useAsyncBatcher.cjs');
3
- const require_useAsyncBatchedCallback = require('./useAsyncBatchedCallback.cjs');
4
-
5
- exports.useAsyncBatchedCallback = require_useAsyncBatchedCallback.useAsyncBatchedCallback;
6
- exports.useAsyncBatcher = require_useAsyncBatcher.useAsyncBatcher;
7
- var _tanstack_pacer_async_batcher = require("@tanstack/pacer/async-batcher");
8
- Object.keys(_tanstack_pacer_async_batcher).forEach(function (k) {
9
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
10
- enumerable: true,
11
- get: function () { return _tanstack_pacer_async_batcher[k]; }
12
- });
13
- });
@@ -1,4 +0,0 @@
1
- import { PreactAsyncBatcher, PreactAsyncBatcherOptions, useAsyncBatcher } from "./useAsyncBatcher.cjs";
2
- import { useAsyncBatchedCallback } from "./useAsyncBatchedCallback.cjs";
3
- export * from "@tanstack/pacer/async-batcher";
4
- export { PreactAsyncBatcher, PreactAsyncBatcherOptions, useAsyncBatchedCallback, useAsyncBatcher };