@tanstack/angular-pacer 0.23.1 → 0.25.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 (250) hide show
  1. package/README.md +21 -6
  2. package/dist/async-batcher/injectAsyncBatchedCallback.d.ts +2 -5
  3. package/dist/async-batcher/injectAsyncBatchedCallback.js +1 -2
  4. package/dist/async-batcher/injectAsyncBatcher.d.ts +4 -7
  5. package/dist/async-batcher/injectAsyncBatcher.js +1 -2
  6. package/dist/async-debouncer/injectAsyncDebouncedCallback.d.ts +2 -5
  7. package/dist/async-debouncer/injectAsyncDebouncedCallback.js +1 -2
  8. package/dist/async-debouncer/injectAsyncDebouncer.d.ts +4 -7
  9. package/dist/async-debouncer/injectAsyncDebouncer.js +1 -2
  10. package/dist/async-queuer/injectAsyncQueuedSignal.d.ts +3 -6
  11. package/dist/async-queuer/injectAsyncQueuedSignal.js +1 -2
  12. package/dist/async-queuer/injectAsyncQueuer.d.ts +4 -7
  13. package/dist/async-queuer/injectAsyncQueuer.js +1 -2
  14. package/dist/async-rate-limiter/injectAsyncRateLimitedCallback.d.ts +2 -5
  15. package/dist/async-rate-limiter/injectAsyncRateLimitedCallback.js +1 -2
  16. package/dist/async-rate-limiter/injectAsyncRateLimiter.d.ts +4 -7
  17. package/dist/async-rate-limiter/injectAsyncRateLimiter.js +1 -2
  18. package/dist/async-throttler/injectAsyncThrottledCallback.d.ts +2 -5
  19. package/dist/async-throttler/injectAsyncThrottledCallback.js +1 -2
  20. package/dist/async-throttler/injectAsyncThrottler.d.ts +4 -7
  21. package/dist/async-throttler/injectAsyncThrottler.js +1 -2
  22. package/dist/batcher/injectBatchedCallback.d.ts +2 -5
  23. package/dist/batcher/injectBatchedCallback.js +1 -2
  24. package/dist/batcher/injectBatcher.d.ts +4 -7
  25. package/dist/batcher/injectBatcher.js +1 -2
  26. package/dist/debouncer/injectDebouncedCallback.d.ts +2 -5
  27. package/dist/debouncer/injectDebouncedCallback.js +1 -2
  28. package/dist/debouncer/injectDebouncedSignal.d.ts +3 -6
  29. package/dist/debouncer/injectDebouncedSignal.js +1 -2
  30. package/dist/debouncer/injectDebouncedValue.d.ts +3 -6
  31. package/dist/debouncer/injectDebouncedValue.js +1 -2
  32. package/dist/debouncer/injectDebouncer.d.ts +4 -7
  33. package/dist/debouncer/injectDebouncer.js +1 -2
  34. package/dist/provider/pacer-context.d.ts +4 -7
  35. package/dist/provider/pacer-context.js +1 -2
  36. package/dist/provider/pacer-provider.d.ts +2 -5
  37. package/dist/provider/pacer-provider.js +1 -2
  38. package/dist/queuer/injectQueuedSignal.d.ts +3 -6
  39. package/dist/queuer/injectQueuedSignal.js +1 -2
  40. package/dist/queuer/injectQueuedValue.d.ts +3 -6
  41. package/dist/queuer/injectQueuedValue.js +1 -2
  42. package/dist/queuer/injectQueuer.d.ts +4 -7
  43. package/dist/queuer/injectQueuer.js +1 -2
  44. package/dist/rate-limiter/injectRateLimitedCallback.d.ts +2 -5
  45. package/dist/rate-limiter/injectRateLimitedCallback.js +1 -2
  46. package/dist/rate-limiter/injectRateLimitedSignal.d.ts +3 -6
  47. package/dist/rate-limiter/injectRateLimitedSignal.js +1 -2
  48. package/dist/rate-limiter/injectRateLimitedValue.d.ts +3 -6
  49. package/dist/rate-limiter/injectRateLimitedValue.js +1 -2
  50. package/dist/rate-limiter/injectRateLimiter.d.ts +4 -7
  51. package/dist/rate-limiter/injectRateLimiter.js +1 -2
  52. package/dist/throttler/injectThrottledCallback.d.ts +2 -5
  53. package/dist/throttler/injectThrottledCallback.js +1 -2
  54. package/dist/throttler/injectThrottledSignal.d.ts +3 -8
  55. package/dist/throttler/injectThrottledSignal.js +1 -4
  56. package/dist/throttler/injectThrottledValue.d.ts +3 -8
  57. package/dist/throttler/injectThrottledValue.js +1 -2
  58. package/dist/throttler/injectThrottler.d.ts +4 -9
  59. package/dist/throttler/injectThrottler.js +1 -4
  60. package/package.json +25 -72
  61. package/dist/async-batcher/index.cjs +0 -13
  62. package/dist/async-batcher/index.d.cts +0 -4
  63. package/dist/async-batcher/injectAsyncBatchedCallback.cjs +0 -49
  64. package/dist/async-batcher/injectAsyncBatchedCallback.cjs.map +0 -1
  65. package/dist/async-batcher/injectAsyncBatchedCallback.d.cts +0 -45
  66. package/dist/async-batcher/injectAsyncBatchedCallback.js.map +0 -1
  67. package/dist/async-batcher/injectAsyncBatcher.cjs +0 -85
  68. package/dist/async-batcher/injectAsyncBatcher.cjs.map +0 -1
  69. package/dist/async-batcher/injectAsyncBatcher.d.cts +0 -85
  70. package/dist/async-batcher/injectAsyncBatcher.js.map +0 -1
  71. package/dist/async-debouncer/index.cjs +0 -13
  72. package/dist/async-debouncer/index.d.cts +0 -4
  73. package/dist/async-debouncer/injectAsyncDebouncedCallback.cjs +0 -49
  74. package/dist/async-debouncer/injectAsyncDebouncedCallback.cjs.map +0 -1
  75. package/dist/async-debouncer/injectAsyncDebouncedCallback.d.cts +0 -43
  76. package/dist/async-debouncer/injectAsyncDebouncedCallback.js.map +0 -1
  77. package/dist/async-debouncer/injectAsyncDebouncer.cjs +0 -107
  78. package/dist/async-debouncer/injectAsyncDebouncer.cjs.map +0 -1
  79. package/dist/async-debouncer/injectAsyncDebouncer.d.cts +0 -108
  80. package/dist/async-debouncer/injectAsyncDebouncer.js.map +0 -1
  81. package/dist/async-queuer/index.cjs +0 -13
  82. package/dist/async-queuer/index.d.cts +0 -4
  83. package/dist/async-queuer/injectAsyncQueuedSignal.cjs +0 -53
  84. package/dist/async-queuer/injectAsyncQueuedSignal.cjs.map +0 -1
  85. package/dist/async-queuer/injectAsyncQueuedSignal.d.cts +0 -50
  86. package/dist/async-queuer/injectAsyncQueuedSignal.js.map +0 -1
  87. package/dist/async-queuer/injectAsyncQueuer.cjs +0 -85
  88. package/dist/async-queuer/injectAsyncQueuer.cjs.map +0 -1
  89. package/dist/async-queuer/injectAsyncQueuer.d.cts +0 -85
  90. package/dist/async-queuer/injectAsyncQueuer.js.map +0 -1
  91. package/dist/async-rate-limiter/index.cjs +0 -13
  92. package/dist/async-rate-limiter/index.d.cts +0 -4
  93. package/dist/async-rate-limiter/injectAsyncRateLimitedCallback.cjs +0 -52
  94. package/dist/async-rate-limiter/injectAsyncRateLimitedCallback.cjs.map +0 -1
  95. package/dist/async-rate-limiter/injectAsyncRateLimitedCallback.d.cts +0 -46
  96. package/dist/async-rate-limiter/injectAsyncRateLimitedCallback.js.map +0 -1
  97. package/dist/async-rate-limiter/injectAsyncRateLimiter.cjs +0 -69
  98. package/dist/async-rate-limiter/injectAsyncRateLimiter.cjs.map +0 -1
  99. package/dist/async-rate-limiter/injectAsyncRateLimiter.d.cts +0 -72
  100. package/dist/async-rate-limiter/injectAsyncRateLimiter.js.map +0 -1
  101. package/dist/async-retryer/index.cjs +0 -9
  102. package/dist/async-retryer/index.d.cts +0 -1
  103. package/dist/async-throttler/index.cjs +0 -13
  104. package/dist/async-throttler/index.d.cts +0 -4
  105. package/dist/async-throttler/injectAsyncThrottledCallback.cjs +0 -50
  106. package/dist/async-throttler/injectAsyncThrottledCallback.cjs.map +0 -1
  107. package/dist/async-throttler/injectAsyncThrottledCallback.d.cts +0 -44
  108. package/dist/async-throttler/injectAsyncThrottledCallback.js.map +0 -1
  109. package/dist/async-throttler/injectAsyncThrottler.cjs +0 -86
  110. package/dist/async-throttler/injectAsyncThrottler.cjs.map +0 -1
  111. package/dist/async-throttler/injectAsyncThrottler.d.cts +0 -87
  112. package/dist/async-throttler/injectAsyncThrottler.js.map +0 -1
  113. package/dist/batcher/index.cjs +0 -13
  114. package/dist/batcher/index.d.cts +0 -4
  115. package/dist/batcher/injectBatchedCallback.cjs +0 -47
  116. package/dist/batcher/injectBatchedCallback.cjs.map +0 -1
  117. package/dist/batcher/injectBatchedCallback.d.cts +0 -43
  118. package/dist/batcher/injectBatchedCallback.js.map +0 -1
  119. package/dist/batcher/injectBatcher.cjs +0 -75
  120. package/dist/batcher/injectBatcher.cjs.map +0 -1
  121. package/dist/batcher/injectBatcher.d.cts +0 -77
  122. package/dist/batcher/injectBatcher.js.map +0 -1
  123. package/dist/debouncer/index.cjs +0 -17
  124. package/dist/debouncer/index.d.cts +0 -6
  125. package/dist/debouncer/injectDebouncedCallback.cjs +0 -46
  126. package/dist/debouncer/injectDebouncedCallback.cjs.map +0 -1
  127. package/dist/debouncer/injectDebouncedCallback.d.cts +0 -43
  128. package/dist/debouncer/injectDebouncedCallback.js.map +0 -1
  129. package/dist/debouncer/injectDebouncedSignal.cjs +0 -68
  130. package/dist/debouncer/injectDebouncedSignal.cjs.map +0 -1
  131. package/dist/debouncer/injectDebouncedSignal.d.cts +0 -60
  132. package/dist/debouncer/injectDebouncedSignal.js.map +0 -1
  133. package/dist/debouncer/injectDebouncedValue.cjs +0 -17
  134. package/dist/debouncer/injectDebouncedValue.cjs.map +0 -1
  135. package/dist/debouncer/injectDebouncedValue.d.cts +0 -76
  136. package/dist/debouncer/injectDebouncedValue.js.map +0 -1
  137. package/dist/debouncer/injectDebouncer.cjs +0 -95
  138. package/dist/debouncer/injectDebouncer.cjs.map +0 -1
  139. package/dist/debouncer/injectDebouncer.d.cts +0 -98
  140. package/dist/debouncer/injectDebouncer.js.map +0 -1
  141. package/dist/index.cjs +0 -65
  142. package/dist/index.d.cts +0 -30
  143. package/dist/provider/index.cjs +0 -7
  144. package/dist/provider/index.d.cts +0 -3
  145. package/dist/provider/pacer-context.cjs +0 -20
  146. package/dist/provider/pacer-context.cjs.map +0 -1
  147. package/dist/provider/pacer-context.d.cts +0 -21
  148. package/dist/provider/pacer-context.js.map +0 -1
  149. package/dist/provider/pacer-provider.cjs +0 -41
  150. package/dist/provider/pacer-provider.cjs.map +0 -1
  151. package/dist/provider/pacer-provider.d.cts +0 -36
  152. package/dist/provider/pacer-provider.js.map +0 -1
  153. package/dist/queuer/index.cjs +0 -15
  154. package/dist/queuer/index.d.cts +0 -5
  155. package/dist/queuer/injectQueuedSignal.cjs +0 -47
  156. package/dist/queuer/injectQueuedSignal.cjs.map +0 -1
  157. package/dist/queuer/injectQueuedSignal.d.cts +0 -44
  158. package/dist/queuer/injectQueuedSignal.js.map +0 -1
  159. package/dist/queuer/injectQueuedValue.cjs +0 -23
  160. package/dist/queuer/injectQueuedValue.cjs.map +0 -1
  161. package/dist/queuer/injectQueuedValue.d.cts +0 -34
  162. package/dist/queuer/injectQueuedValue.js.map +0 -1
  163. package/dist/queuer/injectQueuer.cjs +0 -80
  164. package/dist/queuer/injectQueuer.cjs.map +0 -1
  165. package/dist/queuer/injectQueuer.d.cts +0 -82
  166. package/dist/queuer/injectQueuer.js.map +0 -1
  167. package/dist/rate-limiter/index.cjs +0 -17
  168. package/dist/rate-limiter/index.d.cts +0 -6
  169. package/dist/rate-limiter/injectRateLimitedCallback.cjs +0 -45
  170. package/dist/rate-limiter/injectRateLimitedCallback.cjs.map +0 -1
  171. package/dist/rate-limiter/injectRateLimitedCallback.d.cts +0 -42
  172. package/dist/rate-limiter/injectRateLimitedCallback.js.map +0 -1
  173. package/dist/rate-limiter/injectRateLimitedSignal.cjs +0 -62
  174. package/dist/rate-limiter/injectRateLimitedSignal.cjs.map +0 -1
  175. package/dist/rate-limiter/injectRateLimitedSignal.d.cts +0 -54
  176. package/dist/rate-limiter/injectRateLimitedSignal.js.map +0 -1
  177. package/dist/rate-limiter/injectRateLimitedValue.cjs +0 -17
  178. package/dist/rate-limiter/injectRateLimitedValue.cjs.map +0 -1
  179. package/dist/rate-limiter/injectRateLimitedValue.d.cts +0 -49
  180. package/dist/rate-limiter/injectRateLimitedValue.js.map +0 -1
  181. package/dist/rate-limiter/injectRateLimiter.cjs +0 -100
  182. package/dist/rate-limiter/injectRateLimiter.cjs.map +0 -1
  183. package/dist/rate-limiter/injectRateLimiter.d.cts +0 -103
  184. package/dist/rate-limiter/injectRateLimiter.js.map +0 -1
  185. package/dist/throttler/index.cjs +0 -17
  186. package/dist/throttler/index.d.cts +0 -6
  187. package/dist/throttler/injectThrottledCallback.cjs +0 -45
  188. package/dist/throttler/injectThrottledCallback.cjs.map +0 -1
  189. package/dist/throttler/injectThrottledCallback.d.cts +0 -42
  190. package/dist/throttler/injectThrottledCallback.js.map +0 -1
  191. package/dist/throttler/injectThrottledSignal.cjs +0 -69
  192. package/dist/throttler/injectThrottledSignal.cjs.map +0 -1
  193. package/dist/throttler/injectThrottledSignal.d.cts +0 -61
  194. package/dist/throttler/injectThrottledSignal.js.map +0 -1
  195. package/dist/throttler/injectThrottledValue.cjs +0 -17
  196. package/dist/throttler/injectThrottledValue.cjs.map +0 -1
  197. package/dist/throttler/injectThrottledValue.d.cts +0 -74
  198. package/dist/throttler/injectThrottledValue.js.map +0 -1
  199. package/dist/throttler/injectThrottler.cjs +0 -95
  200. package/dist/throttler/injectThrottler.cjs.map +0 -1
  201. package/dist/throttler/injectThrottler.d.cts +0 -98
  202. package/dist/throttler/injectThrottler.js.map +0 -1
  203. package/dist/types/index.cjs +0 -9
  204. package/dist/types/index.d.cts +0 -1
  205. package/dist/utils/index.cjs +0 -9
  206. package/dist/utils/index.d.cts +0 -1
  207. package/src/async-batcher/index.ts +0 -4
  208. package/src/async-batcher/injectAsyncBatchedCallback.ts +0 -48
  209. package/src/async-batcher/injectAsyncBatcher.ts +0 -126
  210. package/src/async-debouncer/index.ts +0 -4
  211. package/src/async-debouncer/injectAsyncDebouncedCallback.ts +0 -50
  212. package/src/async-debouncer/injectAsyncDebouncer.ts +0 -152
  213. package/src/async-queuer/index.ts +0 -4
  214. package/src/async-queuer/injectAsyncQueuedSignal.ts +0 -74
  215. package/src/async-queuer/injectAsyncQueuer.ts +0 -126
  216. package/src/async-rate-limiter/index.ts +0 -4
  217. package/src/async-rate-limiter/injectAsyncRateLimitedCallback.ts +0 -52
  218. package/src/async-rate-limiter/injectAsyncRateLimiter.ts +0 -115
  219. package/src/async-retryer/index.ts +0 -1
  220. package/src/async-throttler/index.ts +0 -4
  221. package/src/async-throttler/injectAsyncThrottledCallback.ts +0 -50
  222. package/src/async-throttler/injectAsyncThrottler.ts +0 -131
  223. package/src/batcher/index.ts +0 -4
  224. package/src/batcher/injectBatchedCallback.ts +0 -46
  225. package/src/batcher/injectBatcher.ts +0 -114
  226. package/src/debouncer/index.ts +0 -6
  227. package/src/debouncer/injectDebouncedCallback.ts +0 -46
  228. package/src/debouncer/injectDebouncedSignal.ts +0 -94
  229. package/src/debouncer/injectDebouncedValue.ts +0 -126
  230. package/src/debouncer/injectDebouncer.ts +0 -137
  231. package/src/index.ts +0 -40
  232. package/src/provider/index.ts +0 -2
  233. package/src/provider/pacer-context.ts +0 -46
  234. package/src/provider/pacer-provider.ts +0 -38
  235. package/src/queuer/index.ts +0 -5
  236. package/src/queuer/injectQueuedSignal.ts +0 -65
  237. package/src/queuer/injectQueuedValue.ts +0 -101
  238. package/src/queuer/injectQueuer.ts +0 -118
  239. package/src/rate-limiter/index.ts +0 -6
  240. package/src/rate-limiter/injectRateLimitedCallback.ts +0 -45
  241. package/src/rate-limiter/injectRateLimitedSignal.ts +0 -88
  242. package/src/rate-limiter/injectRateLimitedValue.ts +0 -99
  243. package/src/rate-limiter/injectRateLimiter.ts +0 -140
  244. package/src/throttler/index.ts +0 -6
  245. package/src/throttler/injectThrottledCallback.ts +0 -45
  246. package/src/throttler/injectThrottledSignal.ts +0 -95
  247. package/src/throttler/injectThrottledValue.ts +0 -124
  248. package/src/throttler/injectThrottler.ts +0 -137
  249. package/src/types/index.ts +0 -1
  250. package/src/utils/index.ts +0 -1
@@ -1,8 +1,7 @@
1
1
  import { AngularQueuer } from "./injectQueuer.js";
2
2
  import { QueuerOptions, QueuerState } from "@tanstack/pacer/queuer";
3
-
4
3
  //#region src/queuer/injectQueuedSignal.d.ts
5
- interface QueuedSignal<TValue, TSelected = {}> {
4
+ export interface QueuedSignal<TValue, TSelected = {}> {
6
5
  (): Array<TValue>;
7
6
  addItem: AngularQueuer<TValue, TSelected>['addItem'];
8
7
  queuer: AngularQueuer<TValue, TSelected>;
@@ -38,7 +37,5 @@ interface QueuedSignal<TValue, TSelected = {}> {
38
37
  * queued.queuer.stop();
39
38
  * ```
40
39
  */
41
- declare function injectQueuedSignal<TValue, TSelected extends Pick<QueuerState<TValue>, 'items'> = Pick<QueuerState<TValue>, 'items'>>(fn: (item: TValue) => void, options?: QueuerOptions<TValue>, selector?: (state: QueuerState<TValue>) => TSelected): QueuedSignal<TValue, TSelected>;
42
- //#endregion
43
- export { QueuedSignal, injectQueuedSignal };
44
- //# sourceMappingURL=injectQueuedSignal.d.ts.map
40
+ export declare function injectQueuedSignal<TValue, TSelected extends Pick<QueuerState<TValue>, 'items'> = Pick<QueuerState<TValue>, 'items'>>(fn: (item: TValue) => void, options?: QueuerOptions<TValue>, selector?: (state: QueuerState<TValue>) => TSelected): QueuedSignal<TValue, TSelected>;
41
+ //#endregion
@@ -43,5 +43,4 @@ function injectQueuedSignal(fn, options = {}, selector = (state) => ({ items: st
43
43
  }
44
44
 
45
45
  //#endregion
46
- export { injectQueuedSignal };
47
- //# sourceMappingURL=injectQueuedSignal.js.map
46
+ export { injectQueuedSignal };
@@ -1,7 +1,6 @@
1
1
  import { QueuedSignal } from "./injectQueuedSignal.js";
2
2
  import { Signal } from "@angular/core";
3
3
  import { QueuerOptions, QueuerState } from "@tanstack/pacer/queuer";
4
-
5
4
  //#region src/queuer/injectQueuedValue.d.ts
6
5
  /**
7
6
  * An Angular function that creates a queued value that processes state changes in order with an optional delay.
@@ -27,8 +26,6 @@ import { QueuerOptions, QueuerState } from "@tanstack/pacer/queuer";
27
26
  * queued.addItem('new value')
28
27
  * ```
29
28
  */
30
- declare function injectQueuedValue<TValue, TSelected extends Pick<QueuerState<TValue>, 'items'> = Pick<QueuerState<TValue>, 'items'>>(value: Signal<TValue>, options?: QueuerOptions<TValue>, selector?: (state: QueuerState<TValue>) => TSelected): QueuedSignal<TValue, TSelected>;
31
- declare function injectQueuedValue<TValue, TSelected extends Pick<QueuerState<TValue>, 'items'> = Pick<QueuerState<TValue>, 'items'>>(value: Signal<TValue>, initialValue: TValue, options?: QueuerOptions<TValue>, selector?: (state: QueuerState<TValue>) => TSelected): QueuedSignal<TValue, TSelected>;
32
- //#endregion
33
- export { injectQueuedValue };
34
- //# sourceMappingURL=injectQueuedValue.d.ts.map
29
+ export declare function injectQueuedValue<TValue, TSelected extends Pick<QueuerState<TValue>, 'items'> = Pick<QueuerState<TValue>, 'items'>>(value: Signal<TValue>, options?: QueuerOptions<TValue>, selector?: (state: QueuerState<TValue>) => TSelected): QueuedSignal<TValue, TSelected>;
30
+ export declare function injectQueuedValue<TValue, TSelected extends Pick<QueuerState<TValue>, 'items'> = Pick<QueuerState<TValue>, 'items'>>(value: Signal<TValue>, initialValue: TValue, options?: QueuerOptions<TValue>, selector?: (state: QueuerState<TValue>) => TSelected): QueuedSignal<TValue, TSelected>;
31
+ //#endregion
@@ -19,5 +19,4 @@ function injectQueuedValue(value, initialValueOrOptions, initialOptionsOrSelecto
19
19
  }
20
20
 
21
21
  //#endregion
22
- export { injectQueuedValue };
23
- //# sourceMappingURL=injectQueuedValue.js.map
22
+ export { injectQueuedValue };
@@ -1,16 +1,15 @@
1
1
  import { Signal } from "@angular/core";
2
2
  import { Store } from "@tanstack/angular-store";
3
3
  import { Queuer, QueuerOptions, QueuerState } from "@tanstack/pacer/queuer";
4
-
5
4
  //#region src/queuer/injectQueuer.d.ts
6
- interface AngularQueuerOptions<TValue, TSelected = {}> extends QueuerOptions<TValue> {
5
+ export interface AngularQueuerOptions<TValue, TSelected = {}> extends QueuerOptions<TValue> {
7
6
  /**
8
7
  * Optional callback invoked when the component is destroyed. Receives the queuer instance.
9
8
  * When provided, replaces the default cleanup (stop); use it to call flush(), stop(), add logging, etc.
10
9
  */
11
10
  onUnmount?: (queuer: AngularQueuer<TValue, TSelected>) => void;
12
11
  }
13
- interface AngularQueuer<TValue, TSelected = {}> extends Omit<Queuer<TValue>, 'store'> {
12
+ export interface AngularQueuer<TValue, TSelected = {}> extends Omit<Queuer<TValue>, 'store'> {
14
13
  /**
15
14
  * Reactive state signal that will be updated when the queuer state changes
16
15
  *
@@ -76,7 +75,5 @@ interface AngularQueuer<TValue, TSelected = {}> extends Omit<Queuer<TValue>, 'st
76
75
  * });
77
76
  * ```
78
77
  */
79
- declare function injectQueuer<TValue, TSelected = {}>(fn: (item: TValue) => void, options?: AngularQueuerOptions<TValue, TSelected>, selector?: (state: QueuerState<TValue>) => TSelected): AngularQueuer<TValue, TSelected>;
80
- //#endregion
81
- export { AngularQueuer, AngularQueuerOptions, injectQueuer };
82
- //# sourceMappingURL=injectQueuer.d.ts.map
78
+ export declare function injectQueuer<TValue, TSelected = {}>(fn: (item: TValue) => void, options?: AngularQueuerOptions<TValue, TSelected>, selector?: (state: QueuerState<TValue>) => TSelected): AngularQueuer<TValue, TSelected>;
79
+ //#endregion
@@ -76,5 +76,4 @@ function injectQueuer(fn, options = {}, selector = () => ({})) {
76
76
  }
77
77
 
78
78
  //#endregion
79
- export { injectQueuer };
80
- //# sourceMappingURL=injectQueuer.js.map
79
+ export { injectQueuer };
@@ -1,6 +1,5 @@
1
1
  import { RateLimiterOptions } from "@tanstack/pacer/rate-limiter";
2
2
  import { AnyFunction } from "@tanstack/pacer/types";
3
-
4
3
  //#region src/rate-limiter/injectRateLimitedCallback.d.ts
5
4
  /**
6
5
  * An Angular function that creates a rate-limited version of a callback function.
@@ -36,7 +35,5 @@ import { AnyFunction } from "@tanstack/pacer/types";
36
35
  * );
37
36
  * ```
38
37
  */
39
- declare function injectRateLimitedCallback<TFn extends AnyFunction>(fn: TFn, options: RateLimiterOptions<TFn>): (...args: Parameters<TFn>) => boolean;
40
- //#endregion
41
- export { injectRateLimitedCallback };
42
- //# sourceMappingURL=injectRateLimitedCallback.d.ts.map
38
+ export declare function injectRateLimitedCallback<TFn extends AnyFunction>(fn: TFn, options: RateLimiterOptions<TFn>): (...args: Parameters<TFn>) => boolean;
39
+ //#endregion
@@ -41,5 +41,4 @@ function injectRateLimitedCallback(fn, options) {
41
41
  }
42
42
 
43
43
  //#endregion
44
- export { injectRateLimitedCallback };
45
- //# sourceMappingURL=injectRateLimitedCallback.js.map
44
+ export { injectRateLimitedCallback };
@@ -1,9 +1,8 @@
1
1
  import { AngularRateLimiter } from "./injectRateLimiter.js";
2
2
  import { RateLimiterOptions, RateLimiterState } from "@tanstack/pacer/rate-limiter";
3
-
4
3
  //#region src/rate-limiter/injectRateLimitedSignal.d.ts
5
4
  type Setter<T> = (value: T | ((prev: T) => T)) => void;
6
- interface RateLimitedSignal<TValue, TSelected = {}> {
5
+ export interface RateLimitedSignal<TValue, TSelected = {}> {
7
6
  (): TValue;
8
7
  set: Setter<TValue>;
9
8
  rateLimiter: AngularRateLimiter<Setter<TValue>, TSelected>;
@@ -48,7 +47,5 @@ interface RateLimitedSignal<TValue, TSelected = {}> {
48
47
  * );
49
48
  * ```
50
49
  */
51
- declare function injectRateLimitedSignal<TValue, TSelected = {}>(value: TValue, initialOptions: RateLimiterOptions<Setter<TValue>>, selector?: (state: RateLimiterState) => TSelected): RateLimitedSignal<TValue, TSelected>;
52
- //#endregion
53
- export { RateLimitedSignal, injectRateLimitedSignal };
54
- //# sourceMappingURL=injectRateLimitedSignal.d.ts.map
50
+ export declare function injectRateLimitedSignal<TValue, TSelected = {}>(value: TValue, initialOptions: RateLimiterOptions<Setter<TValue>>, selector?: (state: RateLimiterState) => TSelected): RateLimitedSignal<TValue, TSelected>;
51
+ //#endregion
@@ -58,5 +58,4 @@ function injectRateLimitedSignal(value, initialOptions, selector) {
58
58
  }
59
59
 
60
60
  //#endregion
61
- export { injectRateLimitedSignal };
62
- //# sourceMappingURL=injectRateLimitedSignal.js.map
61
+ export { injectRateLimitedSignal };
@@ -1,7 +1,6 @@
1
1
  import { RateLimitedSignal } from "./injectRateLimitedSignal.js";
2
2
  import { Signal } from "@angular/core";
3
3
  import { RateLimiterOptions, RateLimiterState } from "@tanstack/pacer/rate-limiter";
4
-
5
4
  //#region src/rate-limiter/injectRateLimitedValue.d.ts
6
5
  type Setter<T> = (value: T | ((prev: T) => T)) => void;
7
6
  /**
@@ -42,8 +41,6 @@ type Setter<T> = (value: T | ((prev: T) => T)) => void;
42
41
  * })
43
42
  * ```
44
43
  */
45
- declare function injectRateLimitedValue<TValue, TSelected = {}>(value: Signal<TValue>, initialOptions: RateLimiterOptions<Setter<TValue>>, selector?: (state: RateLimiterState) => TSelected): RateLimitedSignal<TValue, TSelected>;
46
- declare function injectRateLimitedValue<TValue, TSelected = {}>(value: Signal<TValue>, initialValue: TValue, initialOptions: RateLimiterOptions<Setter<TValue>>, selector?: (state: RateLimiterState) => TSelected): RateLimitedSignal<TValue, TSelected>;
47
- //#endregion
48
- export { injectRateLimitedValue };
49
- //# sourceMappingURL=injectRateLimitedValue.d.ts.map
44
+ export declare function injectRateLimitedValue<TValue, TSelected = {}>(value: Signal<TValue>, initialOptions: RateLimiterOptions<Setter<TValue>>, selector?: (state: RateLimiterState) => TSelected): RateLimitedSignal<TValue, TSelected>;
45
+ export declare function injectRateLimitedValue<TValue, TSelected = {}>(value: Signal<TValue>, initialValue: TValue, initialOptions: RateLimiterOptions<Setter<TValue>>, selector?: (state: RateLimiterState) => TSelected): RateLimitedSignal<TValue, TSelected>;
46
+ //#endregion
@@ -13,5 +13,4 @@ function injectRateLimitedValue(value, initialValueOrOptions, initialOptionsOrSe
13
13
  }
14
14
 
15
15
  //#endregion
16
- export { injectRateLimitedValue };
17
- //# sourceMappingURL=injectRateLimitedValue.js.map
16
+ export { injectRateLimitedValue };
@@ -2,15 +2,14 @@ import { Signal } from "@angular/core";
2
2
  import { Store } from "@tanstack/angular-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/injectRateLimiter.d.ts
7
- interface AngularRateLimiterOptions<TFn extends AnyFunction, TSelected = {}> extends RateLimiterOptions<TFn> {
6
+ export interface AngularRateLimiterOptions<TFn extends AnyFunction, TSelected = {}> extends RateLimiterOptions<TFn> {
8
7
  /**
9
8
  * Optional callback invoked when the component is destroyed. Receives the rate limiter instance.
10
9
  */
11
10
  onUnmount?: (rateLimiter: AngularRateLimiter<TFn, TSelected>) => void;
12
11
  }
13
- interface AngularRateLimiter<TFn extends AnyFunction, TSelected = {}> extends Omit<RateLimiter<TFn>, 'store'> {
12
+ export interface AngularRateLimiter<TFn extends AnyFunction, TSelected = {}> extends Omit<RateLimiter<TFn>, 'store'> {
14
13
  /**
15
14
  * Reactive state signal that will be updated when the rate limiter state changes
16
15
  *
@@ -97,7 +96,5 @@ interface AngularRateLimiter<TFn extends AnyFunction, TSelected = {}> extends Om
97
96
  * const { executionCount, rejectionCount } = rateLimiter.state();
98
97
  * ```
99
98
  */
100
- declare function injectRateLimiter<TFn extends AnyFunction, TSelected = {}>(fn: TFn, options: AngularRateLimiterOptions<TFn, TSelected>, selector?: (state: RateLimiterState) => TSelected): AngularRateLimiter<TFn, TSelected>;
101
- //#endregion
102
- export { AngularRateLimiter, AngularRateLimiterOptions, injectRateLimiter };
103
- //# sourceMappingURL=injectRateLimiter.d.ts.map
99
+ export declare function injectRateLimiter<TFn extends AnyFunction, TSelected = {}>(fn: TFn, options: AngularRateLimiterOptions<TFn, TSelected>, selector?: (state: RateLimiterState) => TSelected): AngularRateLimiter<TFn, TSelected>;
100
+ //#endregion
@@ -96,5 +96,4 @@ function injectRateLimiter(fn, options, selector = () => ({})) {
96
96
  }
97
97
 
98
98
  //#endregion
99
- export { injectRateLimiter };
100
- //# sourceMappingURL=injectRateLimiter.js.map
99
+ export { injectRateLimiter };
@@ -1,6 +1,5 @@
1
1
  import { ThrottlerOptions } from "@tanstack/pacer/throttler";
2
2
  import { AnyFunction } from "@tanstack/pacer/types";
3
-
4
3
  //#region src/throttler/injectThrottledCallback.d.ts
5
4
  /**
6
5
  * An Angular function that creates a throttled version of a callback function.
@@ -36,7 +35,5 @@ import { AnyFunction } from "@tanstack/pacer/types";
36
35
  * });
37
36
  * ```
38
37
  */
39
- declare function injectThrottledCallback<TFn extends AnyFunction>(fn: TFn, options: ThrottlerOptions<TFn>): (...args: Parameters<TFn>) => void;
40
- //#endregion
41
- export { injectThrottledCallback };
42
- //# sourceMappingURL=injectThrottledCallback.d.ts.map
38
+ export declare function injectThrottledCallback<TFn extends AnyFunction>(fn: TFn, options: ThrottlerOptions<TFn>): (...args: Parameters<TFn>) => void;
39
+ //#endregion
@@ -41,5 +41,4 @@ function injectThrottledCallback(fn, options) {
41
41
  }
42
42
 
43
43
  //#endregion
44
- export { injectThrottledCallback };
45
- //# sourceMappingURL=injectThrottledCallback.js.map
44
+ export { injectThrottledCallback };
@@ -1,9 +1,8 @@
1
1
  import { AngularThrottler } from "./injectThrottler.js";
2
2
  import { ThrottlerOptions, ThrottlerState } from "@tanstack/pacer/throttler";
3
-
4
3
  //#region src/throttler/injectThrottledSignal.d.ts
5
4
  type Setter<T> = (value: T | ((prev: T) => T)) => void;
6
- interface ThrottledSignal<TValue, TSelected = {}> {
5
+ export interface ThrottledSignal<TValue, TSelected = {}> {
7
6
  (): TValue;
8
7
  set: Setter<TValue>;
9
8
  throttler: AngularThrottler<Setter<TValue>, TSelected>;
@@ -32,8 +31,6 @@ interface ThrottledSignal<TValue, TSelected = {}> {
32
31
  * full control over when your component tracks state changes.
33
32
  *
34
33
  * Available throttler state properties:
35
- * - `canLeadingExecute`: Whether the throttler can execute on the leading edge
36
- * - `canTrailingExecute`: Whether the throttler can execute on the trailing edge
37
34
  * - `executionCount`: Number of function executions that have been completed
38
35
  * - `isPending`: Whether the throttler is waiting for the timeout to trigger execution
39
36
  * - `lastArgs`: The arguments from the most recent call to maybeExecute
@@ -55,7 +52,5 @@ interface ThrottledSignal<TValue, TSelected = {}> {
55
52
  * console.log(throttledScrollY.throttler.state().isPending)
56
53
  * ```
57
54
  */
58
- declare function injectThrottledSignal<TValue, TSelected = {}>(value: TValue, initialOptions: ThrottlerOptions<Setter<TValue>>, selector?: (state: ThrottlerState<Setter<TValue>>) => TSelected): ThrottledSignal<TValue, TSelected>;
59
- //#endregion
60
- export { ThrottledSignal, injectThrottledSignal };
61
- //# sourceMappingURL=injectThrottledSignal.d.ts.map
55
+ export declare function injectThrottledSignal<TValue, TSelected = {}>(value: TValue, initialOptions: ThrottlerOptions<Setter<TValue>>, selector?: (state: ThrottlerState<Setter<TValue>>) => TSelected): ThrottledSignal<TValue, TSelected>;
56
+ //#endregion
@@ -26,8 +26,6 @@ import { signal } from "@angular/core";
26
26
  * full control over when your component tracks state changes.
27
27
  *
28
28
  * Available throttler state properties:
29
- * - `canLeadingExecute`: Whether the throttler can execute on the leading edge
30
- * - `canTrailingExecute`: Whether the throttler can execute on the trailing edge
31
29
  * - `executionCount`: Number of function executions that have been completed
32
30
  * - `isPending`: Whether the throttler is waiting for the timeout to trigger execution
33
31
  * - `lastArgs`: The arguments from the most recent call to maybeExecute
@@ -65,5 +63,4 @@ function injectThrottledSignal(value, initialOptions, selector) {
65
63
  }
66
64
 
67
65
  //#endregion
68
- export { injectThrottledSignal };
69
- //# sourceMappingURL=injectThrottledSignal.js.map
66
+ export { injectThrottledSignal };
@@ -1,7 +1,6 @@
1
1
  import { ThrottledSignal } from "./injectThrottledSignal.js";
2
2
  import { Signal } from "@angular/core";
3
3
  import { ThrottlerOptions, ThrottlerState } from "@tanstack/pacer/throttler";
4
-
5
4
  //#region src/throttler/injectThrottledValue.d.ts
6
5
  type Setter<T> = (value: T | ((prev: T) => T)) => void;
7
6
  /**
@@ -31,8 +30,6 @@ type Setter<T> = (value: T | ((prev: T) => T)) => void;
31
30
  * full control over when your component tracks state changes.
32
31
  *
33
32
  * Available throttler state properties:
34
- * - `canLeadingExecute`: Whether the throttler can execute on the leading edge
35
- * - `canTrailingExecute`: Whether the throttler can execute on the trailing edge
36
33
  * - `executionCount`: Number of function executions that have been completed
37
34
  * - `isPending`: Whether the throttler is waiting for the timeout to trigger execution
38
35
  * - `lastArgs`: The arguments from the most recent call to maybeExecute
@@ -67,8 +64,6 @@ type Setter<T> = (value: T | ((prev: T) => T)) => void;
67
64
  * throttledScrollY.cancel() // Cancel any pending updates
68
65
  * ```
69
66
  */
70
- declare function injectThrottledValue<TValue, TSelected = {}>(value: Signal<TValue>, initialOptions: ThrottlerOptions<Setter<TValue>>, selector?: (state: ThrottlerState<Setter<TValue>>) => TSelected): ThrottledSignal<TValue, TSelected>;
71
- declare function injectThrottledValue<TValue, TSelected = {}>(value: Signal<TValue>, initialValue: TValue, initialOptions: ThrottlerOptions<Setter<TValue>>, selector?: (state: ThrottlerState<Setter<TValue>>) => TSelected): ThrottledSignal<TValue, TSelected>;
72
- //#endregion
73
- export { injectThrottledValue };
74
- //# sourceMappingURL=injectThrottledValue.d.ts.map
67
+ export declare function injectThrottledValue<TValue, TSelected = {}>(value: Signal<TValue>, initialOptions: ThrottlerOptions<Setter<TValue>>, selector?: (state: ThrottlerState<Setter<TValue>>) => TSelected): ThrottledSignal<TValue, TSelected>;
68
+ export declare function injectThrottledValue<TValue, TSelected = {}>(value: Signal<TValue>, initialValue: TValue, initialOptions: ThrottlerOptions<Setter<TValue>>, selector?: (state: ThrottlerState<Setter<TValue>>) => TSelected): ThrottledSignal<TValue, TSelected>;
69
+ //#endregion
@@ -13,5 +13,4 @@ function injectThrottledValue(value, initialValueOrOptions, initialOptionsOrSele
13
13
  }
14
14
 
15
15
  //#endregion
16
- export { injectThrottledValue };
17
- //# sourceMappingURL=injectThrottledValue.js.map
16
+ export { injectThrottledValue };
@@ -2,16 +2,15 @@ import { Signal } from "@angular/core";
2
2
  import { Store } from "@tanstack/angular-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/injectThrottler.d.ts
7
- interface AngularThrottlerOptions<TFn extends AnyFunction, TSelected = {}> extends ThrottlerOptions<TFn> {
6
+ export interface AngularThrottlerOptions<TFn extends AnyFunction, TSelected = {}> extends ThrottlerOptions<TFn> {
8
7
  /**
9
8
  * Optional callback invoked when the component is destroyed. Receives the throttler instance.
10
9
  * When provided, replaces the default cleanup (cancel); use it to call flush(), cancel(), add logging, etc.
11
10
  */
12
11
  onUnmount?: (throttler: AngularThrottler<TFn, TSelected>) => void;
13
12
  }
14
- interface AngularThrottler<TFn extends AnyFunction, TSelected = {}> extends Omit<Throttler<TFn>, 'store'> {
13
+ export interface AngularThrottler<TFn extends AnyFunction, TSelected = {}> extends Omit<Throttler<TFn>, 'store'> {
15
14
  /**
16
15
  * Reactive state signal that will be updated when the throttler state changes
17
16
  *
@@ -47,8 +46,6 @@ interface AngularThrottler<TFn extends AnyFunction, TSelected = {}> extends Omit
47
46
  * full control over when your component tracks state changes.
48
47
  *
49
48
  * Available state properties:
50
- * - `canLeadingExecute`: Whether the throttler can execute on the leading edge
51
- * - `canTrailingExecute`: Whether the throttler can execute on the trailing edge
52
49
  * - `executionCount`: Number of function executions that have been completed
53
50
  * - `isPending`: Whether the throttler is waiting for the timeout to trigger execution
54
51
  * - `lastArgs`: The arguments from the most recent call to maybeExecute
@@ -92,7 +89,5 @@ interface AngularThrottler<TFn extends AnyFunction, TSelected = {}> extends Omit
92
89
  * const { isPending } = throttler.state();
93
90
  * ```
94
91
  */
95
- declare function injectThrottler<TFn extends AnyFunction, TSelected = {}>(fn: TFn, options: AngularThrottlerOptions<TFn, TSelected>, selector?: (state: ThrottlerState<TFn>) => TSelected): AngularThrottler<TFn, TSelected>;
96
- //#endregion
97
- export { AngularThrottler, AngularThrottlerOptions, injectThrottler };
98
- //# sourceMappingURL=injectThrottler.d.ts.map
92
+ export declare function injectThrottler<TFn extends AnyFunction, TSelected = {}>(fn: TFn, options: AngularThrottlerOptions<TFn, TSelected>, selector?: (state: ThrottlerState<TFn>) => TSelected): AngularThrottler<TFn, TSelected>;
93
+ //#endregion
@@ -27,8 +27,6 @@ import { Throttler } from "@tanstack/pacer/throttler";
27
27
  * full control over when your component tracks state changes.
28
28
  *
29
29
  * Available state properties:
30
- * - `canLeadingExecute`: Whether the throttler can execute on the leading edge
31
- * - `canTrailingExecute`: Whether the throttler can execute on the trailing edge
32
30
  * - `executionCount`: Number of function executions that have been completed
33
31
  * - `isPending`: Whether the throttler is waiting for the timeout to trigger execution
34
32
  * - `lastArgs`: The arguments from the most recent call to maybeExecute
@@ -91,5 +89,4 @@ function injectThrottler(fn, options, selector = () => ({})) {
91
89
  }
92
90
 
93
91
  //#endregion
94
- export { injectThrottler };
95
- //# sourceMappingURL=injectThrottler.js.map
92
+ export { injectThrottler };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/angular-pacer",
3
- "version": "0.23.1",
3
+ "version": "0.25.0",
4
4
  "description": "Utilities for debouncing and throttling functions in Angular.",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -24,87 +24,39 @@
24
24
  "signals"
25
25
  ],
26
26
  "type": "module",
27
- "main": "./dist/index.cjs",
28
- "module": "./dist/index.js",
29
- "types": "./dist/index.d.cts",
27
+ "types": "./dist/index.d.ts",
30
28
  "exports": {
31
- ".": {
32
- "import": "./dist/index.js",
33
- "require": "./dist/index.cjs"
34
- },
35
- "./async-batcher": {
36
- "import": "./dist/async-batcher/index.js",
37
- "require": "./dist/async-batcher/index.cjs"
38
- },
39
- "./async-debouncer": {
40
- "import": "./dist/async-debouncer/index.js",
41
- "require": "./dist/async-debouncer/index.cjs"
42
- },
43
- "./async-queuer": {
44
- "import": "./dist/async-queuer/index.js",
45
- "require": "./dist/async-queuer/index.cjs"
46
- },
47
- "./async-rate-limiter": {
48
- "import": "./dist/async-rate-limiter/index.js",
49
- "require": "./dist/async-rate-limiter/index.cjs"
50
- },
51
- "./async-retryer": {
52
- "import": "./dist/async-retryer/index.js",
53
- "require": "./dist/async-retryer/index.cjs"
54
- },
55
- "./async-throttler": {
56
- "import": "./dist/async-throttler/index.js",
57
- "require": "./dist/async-throttler/index.cjs"
58
- },
59
- "./batcher": {
60
- "import": "./dist/batcher/index.js",
61
- "require": "./dist/batcher/index.cjs"
62
- },
63
- "./debouncer": {
64
- "import": "./dist/debouncer/index.js",
65
- "require": "./dist/debouncer/index.cjs"
66
- },
67
- "./provider": {
68
- "import": "./dist/provider/index.js",
69
- "require": "./dist/provider/index.cjs"
70
- },
71
- "./queuer": {
72
- "import": "./dist/queuer/index.js",
73
- "require": "./dist/queuer/index.cjs"
74
- },
75
- "./rate-limiter": {
76
- "import": "./dist/rate-limiter/index.js",
77
- "require": "./dist/rate-limiter/index.cjs"
78
- },
79
- "./throttler": {
80
- "import": "./dist/throttler/index.js",
81
- "require": "./dist/throttler/index.cjs"
82
- },
83
- "./types": {
84
- "import": "./dist/types/index.js",
85
- "require": "./dist/types/index.cjs"
86
- },
87
- "./utils": {
88
- "import": "./dist/utils/index.js",
89
- "require": "./dist/utils/index.cjs"
90
- },
29
+ ".": "./dist/index.js",
30
+ "./async-batcher": "./dist/async-batcher/index.js",
31
+ "./async-debouncer": "./dist/async-debouncer/index.js",
32
+ "./async-queuer": "./dist/async-queuer/index.js",
33
+ "./async-rate-limiter": "./dist/async-rate-limiter/index.js",
34
+ "./async-retryer": "./dist/async-retryer/index.js",
35
+ "./async-throttler": "./dist/async-throttler/index.js",
36
+ "./batcher": "./dist/batcher/index.js",
37
+ "./debouncer": "./dist/debouncer/index.js",
38
+ "./provider": "./dist/provider/index.js",
39
+ "./queuer": "./dist/queuer/index.js",
40
+ "./rate-limiter": "./dist/rate-limiter/index.js",
41
+ "./throttler": "./dist/throttler/index.js",
42
+ "./types": "./dist/types/index.js",
43
+ "./utils": "./dist/utils/index.js",
91
44
  "./package.json": "./package.json"
92
45
  },
93
46
  "sideEffects": false,
94
47
  "engines": {
95
- "node": ">=18"
48
+ "node": ">=20"
96
49
  },
97
50
  "files": [
98
- "dist",
99
- "src"
51
+ "dist"
100
52
  ],
101
53
  "dependencies": {
102
- "@tanstack/angular-store": "^0.11.0",
103
- "@tanstack/pacer": "0.21.1"
54
+ "@tanstack/angular-store": "^0.11.1",
55
+ "@tanstack/pacer": "0.23.0"
104
56
  },
105
57
  "devDependencies": {
106
- "@angular/core": "^21.2.12",
107
- "@types/node": "^25.7.0"
58
+ "@angular/core": "^22.2.0",
59
+ "@types/node": "^26.6.2"
108
60
  },
109
61
  "peerDependencies": {
110
62
  "@angular/core": ">=17.0.0"
@@ -116,6 +68,7 @@
116
68
  "test:lib": "vitest --passWithNoTests",
117
69
  "test:lib:dev": "pnpm test:lib --watch",
118
70
  "test:types": "tsc",
119
- "build": "tsdown"
71
+ "build": "tsdown",
72
+ "test:build": "publint --strict && node ../../scripts/verify-package.ts"
120
73
  }
121
74
  }
@@ -1,13 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_injectAsyncBatcher = require('./injectAsyncBatcher.cjs');
3
- const require_injectAsyncBatchedCallback = require('./injectAsyncBatchedCallback.cjs');
4
-
5
- exports.injectAsyncBatchedCallback = require_injectAsyncBatchedCallback.injectAsyncBatchedCallback;
6
- exports.injectAsyncBatcher = require_injectAsyncBatcher.injectAsyncBatcher;
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 { injectAsyncBatchedCallback } from "./injectAsyncBatchedCallback.cjs";
2
- import { AngularAsyncBatcher, AngularAsyncBatcherOptions, injectAsyncBatcher } from "./injectAsyncBatcher.cjs";
3
- export * from "@tanstack/pacer/async-batcher";
4
- export { AngularAsyncBatcher, AngularAsyncBatcherOptions, injectAsyncBatchedCallback, injectAsyncBatcher };
@@ -1,49 +0,0 @@
1
- const require_injectAsyncBatcher = require('./injectAsyncBatcher.cjs');
2
-
3
- //#region src/async-batcher/injectAsyncBatchedCallback.ts
4
- /**
5
- * An Angular function that creates an async batched version of a callback function.
6
- * This function is essentially a wrapper around `injectAsyncBatcher` that provides
7
- * a simplified API for basic async batching needs.
8
- *
9
- * The batched function will collect items and process them in batches asynchronously based on
10
- * the configured conditions (maxSize, wait time, etc.).
11
- *
12
- * This function provides a simpler API compared to `injectAsyncBatcher`, making it ideal for basic
13
- * async batching needs. However, it does not expose the underlying AsyncBatcher instance.
14
- *
15
- * For advanced usage requiring features like:
16
- * - Manual flushing
17
- * - Access to batch state
18
- * - Error handling callbacks
19
- * - Retry support
20
- *
21
- * Consider using the `injectAsyncBatcher` function instead.
22
- *
23
- * @example
24
- * ```ts
25
- * // Batch async API calls
26
- * const batchApiCall = injectAsyncBatchedCallback(
27
- * async (items: Array<Data>) => {
28
- * const response = await fetch('/api/batch', {
29
- * method: 'POST',
30
- * body: JSON.stringify(items)
31
- * });
32
- * return response.json();
33
- * },
34
- * { maxSize: 10, wait: 1000 }
35
- * );
36
- *
37
- * // Items will be batched and sent together
38
- * await batchApiCall(data1);
39
- * await batchApiCall(data2);
40
- * ```
41
- */
42
- function injectAsyncBatchedCallback(fn, options) {
43
- const batcher = require_injectAsyncBatcher.injectAsyncBatcher(fn, options);
44
- return (item) => batcher.addItem(item);
45
- }
46
-
47
- //#endregion
48
- exports.injectAsyncBatchedCallback = injectAsyncBatchedCallback;
49
- //# sourceMappingURL=injectAsyncBatchedCallback.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"injectAsyncBatchedCallback.cjs","names":["injectAsyncBatcher"],"sources":["../../src/async-batcher/injectAsyncBatchedCallback.ts"],"sourcesContent":["import { injectAsyncBatcher } from './injectAsyncBatcher'\nimport type { AsyncBatcherOptions } from '@tanstack/pacer/async-batcher'\n\n/**\n * An Angular function that creates an async batched version of a callback function.\n * This function is essentially a wrapper around `injectAsyncBatcher` that provides\n * a simplified API for basic async batching needs.\n *\n * The batched function will collect items and process them in batches asynchronously based on\n * the configured conditions (maxSize, wait time, etc.).\n *\n * This function provides a simpler API compared to `injectAsyncBatcher`, making it ideal for basic\n * async batching needs. However, it does not expose the underlying AsyncBatcher instance.\n *\n * For advanced usage requiring features like:\n * - Manual flushing\n * - Access to batch state\n * - Error handling callbacks\n * - Retry support\n *\n * Consider using the `injectAsyncBatcher` function instead.\n *\n * @example\n * ```ts\n * // Batch async API calls\n * const batchApiCall = injectAsyncBatchedCallback(\n * async (items: Array<Data>) => {\n * const response = await fetch('/api/batch', {\n * method: 'POST',\n * body: JSON.stringify(items)\n * });\n * return response.json();\n * },\n * { maxSize: 10, wait: 1000 }\n * );\n *\n * // Items will be batched and sent together\n * await batchApiCall(data1);\n * await batchApiCall(data2);\n * ```\n */\nexport function injectAsyncBatchedCallback<TValue>(\n fn: (items: Array<TValue>) => Promise<any>,\n options: AsyncBatcherOptions<TValue>,\n): (item: TValue) => Promise<void> {\n const batcher = injectAsyncBatcher(fn, options)\n return (item: TValue) => batcher.addItem(item)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,SAAgB,2BACd,IACA,SACiC;CACjC,MAAM,UAAUA,8CAAmB,IAAI,QAAQ;CAC/C,QAAQ,SAAiB,QAAQ,QAAQ,KAAK"}
@@ -1,45 +0,0 @@
1
- import { AsyncBatcherOptions } from "@tanstack/pacer/async-batcher";
2
-
3
- //#region src/async-batcher/injectAsyncBatchedCallback.d.ts
4
- /**
5
- * An Angular function that creates an async batched version of a callback function.
6
- * This function is essentially a wrapper around `injectAsyncBatcher` that provides
7
- * a simplified API for basic async batching needs.
8
- *
9
- * The batched function will collect items and process them in batches asynchronously based on
10
- * the configured conditions (maxSize, wait time, etc.).
11
- *
12
- * This function provides a simpler API compared to `injectAsyncBatcher`, making it ideal for basic
13
- * async batching needs. However, it does not expose the underlying AsyncBatcher instance.
14
- *
15
- * For advanced usage requiring features like:
16
- * - Manual flushing
17
- * - Access to batch state
18
- * - Error handling callbacks
19
- * - Retry support
20
- *
21
- * Consider using the `injectAsyncBatcher` function instead.
22
- *
23
- * @example
24
- * ```ts
25
- * // Batch async API calls
26
- * const batchApiCall = injectAsyncBatchedCallback(
27
- * async (items: Array<Data>) => {
28
- * const response = await fetch('/api/batch', {
29
- * method: 'POST',
30
- * body: JSON.stringify(items)
31
- * });
32
- * return response.json();
33
- * },
34
- * { maxSize: 10, wait: 1000 }
35
- * );
36
- *
37
- * // Items will be batched and sent together
38
- * await batchApiCall(data1);
39
- * await batchApiCall(data2);
40
- * ```
41
- */
42
- declare function injectAsyncBatchedCallback<TValue>(fn: (items: Array<TValue>) => Promise<any>, options: AsyncBatcherOptions<TValue>): (item: TValue) => Promise<void>;
43
- //#endregion
44
- export { injectAsyncBatchedCallback };
45
- //# sourceMappingURL=injectAsyncBatchedCallback.d.cts.map