@tanstack/angular-pacer 0.24.0 → 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 +4 -4
  2. package/dist/async-batcher/injectAsyncBatchedCallback.d.ts +2 -4
  3. package/dist/async-batcher/injectAsyncBatchedCallback.js +1 -2
  4. package/dist/async-batcher/injectAsyncBatcher.d.ts +4 -6
  5. package/dist/async-batcher/injectAsyncBatcher.js +1 -2
  6. package/dist/async-debouncer/injectAsyncDebouncedCallback.d.ts +2 -4
  7. package/dist/async-debouncer/injectAsyncDebouncedCallback.js +1 -2
  8. package/dist/async-debouncer/injectAsyncDebouncer.d.ts +4 -6
  9. package/dist/async-debouncer/injectAsyncDebouncer.js +1 -2
  10. package/dist/async-queuer/injectAsyncQueuedSignal.d.ts +3 -5
  11. package/dist/async-queuer/injectAsyncQueuedSignal.js +1 -2
  12. package/dist/async-queuer/injectAsyncQueuer.d.ts +4 -6
  13. package/dist/async-queuer/injectAsyncQueuer.js +1 -2
  14. package/dist/async-rate-limiter/injectAsyncRateLimitedCallback.d.ts +2 -4
  15. package/dist/async-rate-limiter/injectAsyncRateLimitedCallback.js +1 -2
  16. package/dist/async-rate-limiter/injectAsyncRateLimiter.d.ts +4 -6
  17. package/dist/async-rate-limiter/injectAsyncRateLimiter.js +1 -2
  18. package/dist/async-throttler/injectAsyncThrottledCallback.d.ts +2 -4
  19. package/dist/async-throttler/injectAsyncThrottledCallback.js +1 -2
  20. package/dist/async-throttler/injectAsyncThrottler.d.ts +4 -6
  21. package/dist/async-throttler/injectAsyncThrottler.js +1 -2
  22. package/dist/batcher/injectBatchedCallback.d.ts +2 -4
  23. package/dist/batcher/injectBatchedCallback.js +1 -2
  24. package/dist/batcher/injectBatcher.d.ts +4 -6
  25. package/dist/batcher/injectBatcher.js +1 -2
  26. package/dist/debouncer/injectDebouncedCallback.d.ts +2 -4
  27. package/dist/debouncer/injectDebouncedCallback.js +1 -2
  28. package/dist/debouncer/injectDebouncedSignal.d.ts +3 -5
  29. package/dist/debouncer/injectDebouncedSignal.js +1 -2
  30. package/dist/debouncer/injectDebouncedValue.d.ts +3 -5
  31. package/dist/debouncer/injectDebouncedValue.js +1 -2
  32. package/dist/debouncer/injectDebouncer.d.ts +4 -6
  33. package/dist/debouncer/injectDebouncer.js +1 -2
  34. package/dist/provider/pacer-context.d.ts +4 -6
  35. package/dist/provider/pacer-context.js +1 -2
  36. package/dist/provider/pacer-provider.d.ts +2 -4
  37. package/dist/provider/pacer-provider.js +1 -2
  38. package/dist/queuer/injectQueuedSignal.d.ts +3 -5
  39. package/dist/queuer/injectQueuedSignal.js +1 -2
  40. package/dist/queuer/injectQueuedValue.d.ts +3 -5
  41. package/dist/queuer/injectQueuedValue.js +1 -2
  42. package/dist/queuer/injectQueuer.d.ts +4 -6
  43. package/dist/queuer/injectQueuer.js +1 -2
  44. package/dist/rate-limiter/injectRateLimitedCallback.d.ts +2 -4
  45. package/dist/rate-limiter/injectRateLimitedCallback.js +1 -2
  46. package/dist/rate-limiter/injectRateLimitedSignal.d.ts +3 -5
  47. package/dist/rate-limiter/injectRateLimitedSignal.js +1 -2
  48. package/dist/rate-limiter/injectRateLimitedValue.d.ts +3 -5
  49. package/dist/rate-limiter/injectRateLimitedValue.js +1 -2
  50. package/dist/rate-limiter/injectRateLimiter.d.ts +4 -6
  51. package/dist/rate-limiter/injectRateLimiter.js +1 -2
  52. package/dist/throttler/injectThrottledCallback.d.ts +2 -4
  53. package/dist/throttler/injectThrottledCallback.js +1 -2
  54. package/dist/throttler/injectThrottledSignal.d.ts +3 -7
  55. package/dist/throttler/injectThrottledSignal.js +1 -4
  56. package/dist/throttler/injectThrottledValue.d.ts +3 -7
  57. package/dist/throttler/injectThrottledValue.js +1 -2
  58. package/dist/throttler/injectThrottler.d.ts +4 -8
  59. package/dist/throttler/injectThrottler.js +1 -4
  60. package/package.json +24 -71
  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 -44
  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 -84
  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 -42
  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 -107
  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 -49
  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 -84
  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 -45
  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 -71
  100. package/dist/async-rate-limiter/injectAsyncRateLimiter.js.map +0 -1
  101. package/dist/async-retryer/index.cjs +0 -8
  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 -43
  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 -86
  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 -42
  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 -76
  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 -42
  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 -59
  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 -75
  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 -97
  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 -20
  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 -35
  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 -43
  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 -33
  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 -81
  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 -41
  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 -53
  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 -48
  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 -102
  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 -41
  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 -60
  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 -73
  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 -97
  202. package/dist/throttler/injectThrottler.js.map +0 -1
  203. package/dist/types/index.cjs +0 -8
  204. package/dist/types/index.d.cts +0 -1
  205. package/dist/utils/index.cjs +0 -8
  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 -125
  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 -99
  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 -98
  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 -123
  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,20 +0,0 @@
1
- let _angular_core = require("@angular/core");
2
-
3
- //#region src/provider/pacer-context.ts
4
- const DEFAULT_OPTIONS = {};
5
- const PACER_OPTIONS = new _angular_core.InjectionToken("PACER_OPTIONS", {
6
- providedIn: "root",
7
- factory: () => DEFAULT_OPTIONS
8
- });
9
- function injectPacerOptions() {
10
- try {
11
- return (0, _angular_core.inject)(PACER_OPTIONS, { optional: true }) ?? DEFAULT_OPTIONS;
12
- } catch {
13
- return DEFAULT_OPTIONS;
14
- }
15
- }
16
-
17
- //#endregion
18
- exports.PACER_OPTIONS = PACER_OPTIONS;
19
- exports.injectPacerOptions = injectPacerOptions;
20
- //# sourceMappingURL=pacer-context.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pacer-context.cjs","names":["InjectionToken","inject"],"sources":["../../src/provider/pacer-context.ts"],"sourcesContent":["import { InjectionToken, inject } from '@angular/core'\nimport type {\n AnyAsyncFunction,\n AnyFunction,\n AsyncBatcherOptions,\n AsyncDebouncerOptions,\n AsyncQueuerOptions,\n AsyncRateLimiterOptions,\n AsyncThrottlerOptions,\n BatcherOptions,\n DebouncerOptions,\n QueuerOptions,\n RateLimiterOptions,\n ThrottlerOptions,\n} from '@tanstack/pacer'\n\nexport interface PacerProviderOptions {\n asyncBatcher?: Partial<AsyncBatcherOptions<any>>\n asyncDebouncer?: Partial<AsyncDebouncerOptions<AnyAsyncFunction>>\n asyncQueuer?: Partial<AsyncQueuerOptions<any>>\n asyncRateLimiter?: Partial<AsyncRateLimiterOptions<AnyAsyncFunction>>\n asyncThrottler?: Partial<AsyncThrottlerOptions<AnyAsyncFunction>>\n batcher?: Partial<BatcherOptions<any>>\n debouncer?: Partial<DebouncerOptions<AnyFunction>>\n queuer?: Partial<QueuerOptions<any>>\n rateLimiter?: Partial<RateLimiterOptions<AnyFunction>>\n throttler?: Partial<ThrottlerOptions<AnyFunction>>\n}\n\nconst DEFAULT_OPTIONS: PacerProviderOptions = {}\n\nexport const PACER_OPTIONS = new InjectionToken<PacerProviderOptions>(\n 'PACER_OPTIONS',\n {\n providedIn: 'root',\n factory: () => DEFAULT_OPTIONS,\n },\n)\n\nexport function injectPacerOptions(): PacerProviderOptions {\n try {\n return inject(PACER_OPTIONS, { optional: true }) ?? DEFAULT_OPTIONS\n } catch {\n return DEFAULT_OPTIONS\n }\n}\n"],"mappings":";;;AA6BA,MAAM,kBAAwC,CAAC;AAE/C,MAAa,gBAAgB,IAAIA,6BAC/B,iBACA;CACE,YAAY;CACZ,eAAe;AACjB,CACF;AAEA,SAAgB,qBAA2C;CACzD,IAAI;EACF,WAAOC,sBAAO,eAAe,EAAE,UAAU,KAAK,CAAC,KAAK;CACtD,QAAQ;EACN,OAAO;CACT;AACF"}
@@ -1,20 +0,0 @@
1
- import { InjectionToken } from "@angular/core";
2
- import { AnyAsyncFunction, AnyFunction, AsyncBatcherOptions, AsyncDebouncerOptions, AsyncQueuerOptions, AsyncRateLimiterOptions, AsyncThrottlerOptions, BatcherOptions, DebouncerOptions, QueuerOptions, RateLimiterOptions, ThrottlerOptions } from "@tanstack/pacer";
3
- //#region src/provider/pacer-context.d.ts
4
- interface PacerProviderOptions {
5
- asyncBatcher?: Partial<AsyncBatcherOptions<any>>;
6
- asyncDebouncer?: Partial<AsyncDebouncerOptions<AnyAsyncFunction>>;
7
- asyncQueuer?: Partial<AsyncQueuerOptions<any>>;
8
- asyncRateLimiter?: Partial<AsyncRateLimiterOptions<AnyAsyncFunction>>;
9
- asyncThrottler?: Partial<AsyncThrottlerOptions<AnyAsyncFunction>>;
10
- batcher?: Partial<BatcherOptions<any>>;
11
- debouncer?: Partial<DebouncerOptions<AnyFunction>>;
12
- queuer?: Partial<QueuerOptions<any>>;
13
- rateLimiter?: Partial<RateLimiterOptions<AnyFunction>>;
14
- throttler?: Partial<ThrottlerOptions<AnyFunction>>;
15
- }
16
- declare const PACER_OPTIONS: InjectionToken<PacerProviderOptions>;
17
- declare function injectPacerOptions(): PacerProviderOptions;
18
- //#endregion
19
- export { PACER_OPTIONS, PacerProviderOptions, injectPacerOptions };
20
- //# sourceMappingURL=pacer-context.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pacer-context.js","names":[],"sources":["../../src/provider/pacer-context.ts"],"sourcesContent":["import { InjectionToken, inject } from '@angular/core'\nimport type {\n AnyAsyncFunction,\n AnyFunction,\n AsyncBatcherOptions,\n AsyncDebouncerOptions,\n AsyncQueuerOptions,\n AsyncRateLimiterOptions,\n AsyncThrottlerOptions,\n BatcherOptions,\n DebouncerOptions,\n QueuerOptions,\n RateLimiterOptions,\n ThrottlerOptions,\n} from '@tanstack/pacer'\n\nexport interface PacerProviderOptions {\n asyncBatcher?: Partial<AsyncBatcherOptions<any>>\n asyncDebouncer?: Partial<AsyncDebouncerOptions<AnyAsyncFunction>>\n asyncQueuer?: Partial<AsyncQueuerOptions<any>>\n asyncRateLimiter?: Partial<AsyncRateLimiterOptions<AnyAsyncFunction>>\n asyncThrottler?: Partial<AsyncThrottlerOptions<AnyAsyncFunction>>\n batcher?: Partial<BatcherOptions<any>>\n debouncer?: Partial<DebouncerOptions<AnyFunction>>\n queuer?: Partial<QueuerOptions<any>>\n rateLimiter?: Partial<RateLimiterOptions<AnyFunction>>\n throttler?: Partial<ThrottlerOptions<AnyFunction>>\n}\n\nconst DEFAULT_OPTIONS: PacerProviderOptions = {}\n\nexport const PACER_OPTIONS = new InjectionToken<PacerProviderOptions>(\n 'PACER_OPTIONS',\n {\n providedIn: 'root',\n factory: () => DEFAULT_OPTIONS,\n },\n)\n\nexport function injectPacerOptions(): PacerProviderOptions {\n try {\n return inject(PACER_OPTIONS, { optional: true }) ?? DEFAULT_OPTIONS\n } catch {\n return DEFAULT_OPTIONS\n }\n}\n"],"mappings":";;;AA6BA,MAAM,kBAAwC,CAAC;AAE/C,MAAa,gBAAgB,IAAI,eAC/B,iBACA;CACE,YAAY;CACZ,eAAe;AACjB,CACF;AAEA,SAAgB,qBAA2C;CACzD,IAAI;EACF,OAAO,OAAO,eAAe,EAAE,UAAU,KAAK,CAAC,KAAK;CACtD,QAAQ;EACN,OAAO;CACT;AACF"}
@@ -1,41 +0,0 @@
1
- const require_pacer_context = require('./pacer-context.cjs');
2
-
3
- //#region src/provider/pacer-provider.ts
4
- /**
5
- * Provides default options for all Pacer utilities in the Angular application.
6
- * Use this function when configuring your Angular application to set default options
7
- * that will be used by all Pacer utilities throughout your app.
8
- *
9
- * @example
10
- * ```ts
11
- * // In your app.config.ts (standalone)
12
- * export const appConfig: ApplicationConfig = {
13
- * providers: [
14
- * providePacerOptions({
15
- * debouncer: { wait: 300 },
16
- * throttler: { wait: 100 },
17
- * }),
18
- * ],
19
- * };
20
- *
21
- * // Or in NgModule (module-based)
22
- * @NgModule({
23
- * providers: [
24
- * providePacerOptions({
25
- * debouncer: { wait: 300 },
26
- * }),
27
- * ],
28
- * })
29
- * export class AppModule {}
30
- * ```
31
- */
32
- function providePacerOptions(options) {
33
- return {
34
- provide: require_pacer_context.PACER_OPTIONS,
35
- useValue: options
36
- };
37
- }
38
-
39
- //#endregion
40
- exports.providePacerOptions = providePacerOptions;
41
- //# sourceMappingURL=pacer-provider.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pacer-provider.cjs","names":["PACER_OPTIONS"],"sources":["../../src/provider/pacer-provider.ts"],"sourcesContent":["import { PACER_OPTIONS } from './pacer-context'\nimport type { Provider } from '@angular/core'\nimport type { PacerProviderOptions } from './pacer-context'\n\n/**\n * Provides default options for all Pacer utilities in the Angular application.\n * Use this function when configuring your Angular application to set default options\n * that will be used by all Pacer utilities throughout your app.\n *\n * @example\n * ```ts\n * // In your app.config.ts (standalone)\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * providePacerOptions({\n * debouncer: { wait: 300 },\n * throttler: { wait: 100 },\n * }),\n * ],\n * };\n *\n * // Or in NgModule (module-based)\n * @NgModule({\n * providers: [\n * providePacerOptions({\n * debouncer: { wait: 300 },\n * }),\n * ],\n * })\n * export class AppModule {}\n * ```\n */\nexport function providePacerOptions(options: PacerProviderOptions): Provider {\n return {\n provide: PACER_OPTIONS,\n useValue: options,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,SAAgB,oBAAoB,SAAyC;CAC3E,OAAO;EACL,SAASA;EACT,UAAU;CACZ;AACF"}
@@ -1,35 +0,0 @@
1
- import { PacerProviderOptions } from "./pacer-context.cjs";
2
- import { Provider } from "@angular/core";
3
- //#region src/provider/pacer-provider.d.ts
4
- /**
5
- * Provides default options for all Pacer utilities in the Angular application.
6
- * Use this function when configuring your Angular application to set default options
7
- * that will be used by all Pacer utilities throughout your app.
8
- *
9
- * @example
10
- * ```ts
11
- * // In your app.config.ts (standalone)
12
- * export const appConfig: ApplicationConfig = {
13
- * providers: [
14
- * providePacerOptions({
15
- * debouncer: { wait: 300 },
16
- * throttler: { wait: 100 },
17
- * }),
18
- * ],
19
- * };
20
- *
21
- * // Or in NgModule (module-based)
22
- * @NgModule({
23
- * providers: [
24
- * providePacerOptions({
25
- * debouncer: { wait: 300 },
26
- * }),
27
- * ],
28
- * })
29
- * export class AppModule {}
30
- * ```
31
- */
32
- declare function providePacerOptions(options: PacerProviderOptions): Provider;
33
- //#endregion
34
- export { providePacerOptions };
35
- //# sourceMappingURL=pacer-provider.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pacer-provider.js","names":[],"sources":["../../src/provider/pacer-provider.ts"],"sourcesContent":["import { PACER_OPTIONS } from './pacer-context'\nimport type { Provider } from '@angular/core'\nimport type { PacerProviderOptions } from './pacer-context'\n\n/**\n * Provides default options for all Pacer utilities in the Angular application.\n * Use this function when configuring your Angular application to set default options\n * that will be used by all Pacer utilities throughout your app.\n *\n * @example\n * ```ts\n * // In your app.config.ts (standalone)\n * export const appConfig: ApplicationConfig = {\n * providers: [\n * providePacerOptions({\n * debouncer: { wait: 300 },\n * throttler: { wait: 100 },\n * }),\n * ],\n * };\n *\n * // Or in NgModule (module-based)\n * @NgModule({\n * providers: [\n * providePacerOptions({\n * debouncer: { wait: 300 },\n * }),\n * ],\n * })\n * export class AppModule {}\n * ```\n */\nexport function providePacerOptions(options: PacerProviderOptions): Provider {\n return {\n provide: PACER_OPTIONS,\n useValue: options,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,SAAgB,oBAAoB,SAAyC;CAC3E,OAAO;EACL,SAAS;EACT,UAAU;CACZ;AACF"}
@@ -1,15 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_injectQueuer = require('./injectQueuer.cjs');
3
- const require_injectQueuedSignal = require('./injectQueuedSignal.cjs');
4
- const require_injectQueuedValue = require('./injectQueuedValue.cjs');
5
-
6
- exports.injectQueuedSignal = require_injectQueuedSignal.injectQueuedSignal;
7
- exports.injectQueuedValue = require_injectQueuedValue.injectQueuedValue;
8
- exports.injectQueuer = require_injectQueuer.injectQueuer;
9
- var _tanstack_pacer_queuer = require("@tanstack/pacer/queuer");
10
- Object.keys(_tanstack_pacer_queuer).forEach(function (k) {
11
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
12
- enumerable: true,
13
- get: function () { return _tanstack_pacer_queuer[k]; }
14
- });
15
- });
@@ -1,5 +0,0 @@
1
- import { AngularQueuer, AngularQueuerOptions, injectQueuer } from "./injectQueuer.cjs";
2
- import { QueuedSignal, injectQueuedSignal } from "./injectQueuedSignal.cjs";
3
- import { injectQueuedValue } from "./injectQueuedValue.cjs";
4
- export * from "@tanstack/pacer/queuer";
5
- export { AngularQueuer, AngularQueuerOptions, QueuedSignal, injectQueuedSignal, injectQueuedValue, injectQueuer };
@@ -1,47 +0,0 @@
1
- const require_injectQueuer = require('./injectQueuer.cjs');
2
- let _angular_core = require("@angular/core");
3
-
4
- //#region src/queuer/injectQueuedSignal.ts
5
- /**
6
- * An Angular function that creates a queuer with managed state, combining Angular's signals with queuing functionality.
7
- * This function provides both the current queue state and queue control methods.
8
- *
9
- * The queue state is automatically updated whenever items are added, removed, or reordered in the queue.
10
- * All queue operations are reflected in the state array returned by the function.
11
- *
12
- * The function returns a callable object:
13
- * - `queued()`: Get the current queue items as an array
14
- * - `queued.addItem(...)`: Add an item to the queue
15
- * - `queued.queue`: The queuer instance with additional control methods
16
- *
17
- * @example
18
- * ```ts
19
- * // Default behavior - track items
20
- * const queued = injectQueuedSignal(
21
- * (item) => console.log('Processing:', item),
22
- * { started: true, wait: 1000 }
23
- * );
24
- *
25
- * // Add items
26
- * queued.addItem('task1');
27
- *
28
- * // Access items
29
- * console.log(queued()); // ['task1']
30
- *
31
- * // Control the queue
32
- * queued.queuer.start();
33
- * queued.queuer.stop();
34
- * ```
35
- */
36
- function injectQueuedSignal(fn, options = {}, selector = (state) => ({ items: state.items })) {
37
- const queuer = require_injectQueuer.injectQueuer(fn, options, selector);
38
- const items = (0, _angular_core.computed)(() => queuer.state().items);
39
- return Object.assign(items, {
40
- addItem: queuer.addItem.bind(queuer),
41
- queuer
42
- });
43
- }
44
-
45
- //#endregion
46
- exports.injectQueuedSignal = injectQueuedSignal;
47
- //# sourceMappingURL=injectQueuedSignal.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"injectQueuedSignal.cjs","names":["injectQueuer","computed"],"sources":["../../src/queuer/injectQueuedSignal.ts"],"sourcesContent":["import { computed } from '@angular/core'\nimport { injectQueuer } from './injectQueuer'\nimport type { AngularQueuer } from './injectQueuer'\nimport type { QueuerOptions, QueuerState } from '@tanstack/pacer/queuer'\n\nexport interface QueuedSignal<TValue, TSelected = {}> {\n (): Array<TValue>\n addItem: AngularQueuer<TValue, TSelected>['addItem']\n queuer: AngularQueuer<TValue, TSelected>\n}\n\n/**\n * An Angular function that creates a queuer with managed state, combining Angular's signals with queuing functionality.\n * This function provides both the current queue state and queue control methods.\n *\n * The queue state is automatically updated whenever items are added, removed, or reordered in the queue.\n * All queue operations are reflected in the state array returned by the function.\n *\n * The function returns a callable object:\n * - `queued()`: Get the current queue items as an array\n * - `queued.addItem(...)`: Add an item to the queue\n * - `queued.queue`: The queuer instance with additional control methods\n *\n * @example\n * ```ts\n * // Default behavior - track items\n * const queued = injectQueuedSignal(\n * (item) => console.log('Processing:', item),\n * { started: true, wait: 1000 }\n * );\n *\n * // Add items\n * queued.addItem('task1');\n *\n * // Access items\n * console.log(queued()); // ['task1']\n *\n * // Control the queue\n * queued.queuer.start();\n * queued.queuer.stop();\n * ```\n */\nexport function injectQueuedSignal<\n TValue,\n TSelected extends Pick<QueuerState<TValue>, 'items'> = Pick<\n QueuerState<TValue>,\n 'items'\n >,\n>(\n fn: (item: TValue) => void,\n options: QueuerOptions<TValue> = {},\n selector: (state: QueuerState<TValue>) => TSelected = (state) =>\n ({ items: state.items }) as TSelected,\n): QueuedSignal<TValue, TSelected> {\n const queuer = injectQueuer(fn, options, selector)\n\n const items = computed(() => queuer.state().items as Array<TValue>)\n\n const queued = Object.assign(items, {\n addItem: queuer.addItem.bind(queuer),\n queuer,\n }) as QueuedSignal<TValue, TSelected>\n\n return queued\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,SAAgB,mBAOd,IACA,UAAiC,CAAC,GAClC,YAAuD,WACpD,EAAE,OAAO,MAAM,MAAM,IACS;CACjC,MAAM,SAASA,kCAAa,IAAI,SAAS,QAAQ;CAEjD,MAAM,YAAQC,8BAAe,OAAO,MAAM,CAAC,CAAC,KAAsB;CAOlE,OALe,OAAO,OAAO,OAAO;EAClC,SAAS,OAAO,QAAQ,KAAK,MAAM;EACnC;CACF,CAEY;AACd"}
@@ -1,43 +0,0 @@
1
- import { AngularQueuer } from "./injectQueuer.cjs";
2
- import { QueuerOptions, QueuerState } from "@tanstack/pacer/queuer";
3
- //#region src/queuer/injectQueuedSignal.d.ts
4
- interface QueuedSignal<TValue, TSelected = {}> {
5
- (): Array<TValue>;
6
- addItem: AngularQueuer<TValue, TSelected>['addItem'];
7
- queuer: AngularQueuer<TValue, TSelected>;
8
- }
9
- /**
10
- * An Angular function that creates a queuer with managed state, combining Angular's signals with queuing functionality.
11
- * This function provides both the current queue state and queue control methods.
12
- *
13
- * The queue state is automatically updated whenever items are added, removed, or reordered in the queue.
14
- * All queue operations are reflected in the state array returned by the function.
15
- *
16
- * The function returns a callable object:
17
- * - `queued()`: Get the current queue items as an array
18
- * - `queued.addItem(...)`: Add an item to the queue
19
- * - `queued.queue`: The queuer instance with additional control methods
20
- *
21
- * @example
22
- * ```ts
23
- * // Default behavior - track items
24
- * const queued = injectQueuedSignal(
25
- * (item) => console.log('Processing:', item),
26
- * { started: true, wait: 1000 }
27
- * );
28
- *
29
- * // Add items
30
- * queued.addItem('task1');
31
- *
32
- * // Access items
33
- * console.log(queued()); // ['task1']
34
- *
35
- * // Control the queue
36
- * queued.queuer.start();
37
- * queued.queuer.stop();
38
- * ```
39
- */
40
- 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
42
- export { QueuedSignal, injectQueuedSignal };
43
- //# sourceMappingURL=injectQueuedSignal.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"injectQueuedSignal.js","names":[],"sources":["../../src/queuer/injectQueuedSignal.ts"],"sourcesContent":["import { computed } from '@angular/core'\nimport { injectQueuer } from './injectQueuer'\nimport type { AngularQueuer } from './injectQueuer'\nimport type { QueuerOptions, QueuerState } from '@tanstack/pacer/queuer'\n\nexport interface QueuedSignal<TValue, TSelected = {}> {\n (): Array<TValue>\n addItem: AngularQueuer<TValue, TSelected>['addItem']\n queuer: AngularQueuer<TValue, TSelected>\n}\n\n/**\n * An Angular function that creates a queuer with managed state, combining Angular's signals with queuing functionality.\n * This function provides both the current queue state and queue control methods.\n *\n * The queue state is automatically updated whenever items are added, removed, or reordered in the queue.\n * All queue operations are reflected in the state array returned by the function.\n *\n * The function returns a callable object:\n * - `queued()`: Get the current queue items as an array\n * - `queued.addItem(...)`: Add an item to the queue\n * - `queued.queue`: The queuer instance with additional control methods\n *\n * @example\n * ```ts\n * // Default behavior - track items\n * const queued = injectQueuedSignal(\n * (item) => console.log('Processing:', item),\n * { started: true, wait: 1000 }\n * );\n *\n * // Add items\n * queued.addItem('task1');\n *\n * // Access items\n * console.log(queued()); // ['task1']\n *\n * // Control the queue\n * queued.queuer.start();\n * queued.queuer.stop();\n * ```\n */\nexport function injectQueuedSignal<\n TValue,\n TSelected extends Pick<QueuerState<TValue>, 'items'> = Pick<\n QueuerState<TValue>,\n 'items'\n >,\n>(\n fn: (item: TValue) => void,\n options: QueuerOptions<TValue> = {},\n selector: (state: QueuerState<TValue>) => TSelected = (state) =>\n ({ items: state.items }) as TSelected,\n): QueuedSignal<TValue, TSelected> {\n const queuer = injectQueuer(fn, options, selector)\n\n const items = computed(() => queuer.state().items as Array<TValue>)\n\n const queued = Object.assign(items, {\n addItem: queuer.addItem.bind(queuer),\n queuer,\n }) as QueuedSignal<TValue, TSelected>\n\n return queued\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,SAAgB,mBAOd,IACA,UAAiC,CAAC,GAClC,YAAuD,WACpD,EAAE,OAAO,MAAM,MAAM,IACS;CACjC,MAAM,SAAS,aAAa,IAAI,SAAS,QAAQ;CAEjD,MAAM,QAAQ,eAAe,OAAO,MAAM,CAAC,CAAC,KAAsB;CAOlE,OALe,OAAO,OAAO,OAAO;EAClC,SAAS,OAAO,QAAQ,KAAK,MAAM;EACnC;CACF,CAEY;AACd"}
@@ -1,23 +0,0 @@
1
- const require_injectQueuedSignal = require('./injectQueuedSignal.cjs');
2
- let _angular_core = require("@angular/core");
3
-
4
- //#region src/queuer/injectQueuedValue.ts
5
- function injectQueuedValue(value, initialValueOrOptions, initialOptionsOrSelector, maybeSelector) {
6
- const hasInitialValue = initialOptionsOrSelector !== void 0 && !(typeof initialOptionsOrSelector === "function") || maybeSelector !== void 0;
7
- const initialValue = hasInitialValue ? initialValueOrOptions : value();
8
- const initialOptions = hasInitialValue ? initialOptionsOrSelector : initialValueOrOptions;
9
- const selector = hasInitialValue ? maybeSelector : initialOptionsOrSelector;
10
- const linkedValue = (0, _angular_core.linkedSignal)(() => value());
11
- const queuedValue = (0, _angular_core.signal)(initialValue);
12
- const queued = require_injectQueuedSignal.injectQueuedSignal((item) => {
13
- queuedValue.set(item);
14
- }, initialOptions, selector);
15
- (0, _angular_core.effect)(() => {
16
- queued.addItem(linkedValue());
17
- });
18
- return queued;
19
- }
20
-
21
- //#endregion
22
- exports.injectQueuedValue = injectQueuedValue;
23
- //# sourceMappingURL=injectQueuedValue.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"injectQueuedValue.cjs","names":["linkedSignal","signal","injectQueuedSignal"],"sources":["../../src/queuer/injectQueuedValue.ts"],"sourcesContent":["import { effect, linkedSignal, signal } from '@angular/core'\nimport { injectQueuedSignal } from './injectQueuedSignal'\nimport type { QueuedSignal } from './injectQueuedSignal'\nimport type { Signal } from '@angular/core'\nimport type { QueuerOptions, QueuerState } from '@tanstack/pacer/queuer'\n\n/**\n * An Angular function that creates a queued value that processes state changes in order with an optional delay.\n * This function uses injectQueuedSignal internally to manage a queue of state changes and apply them sequentially.\n *\n * The queued value will process changes in the order they are received, with optional delays between\n * processing each change. This is useful for handling state updates that need to be processed\n * in a specific order, like animations or sequential UI updates.\n *\n * The function returns a tuple containing:\n * - A Signal that provides the current queued value\n * - The queuer instance with control methods\n *\n * @example\n * ```ts\n * const initialValue = signal('initial')\n * const queued = injectQueuedValue(initialValue, {\n * wait: 500,\n * started: true,\n * })\n *\n * // Add changes to the queue\n * queued.addItem('new value')\n * ```\n */\nexport function injectQueuedValue<\n TValue,\n TSelected extends Pick<QueuerState<TValue>, 'items'> = Pick<\n QueuerState<TValue>,\n 'items'\n >,\n>(\n value: Signal<TValue>,\n options?: QueuerOptions<TValue>,\n selector?: (state: QueuerState<TValue>) => TSelected,\n): QueuedSignal<TValue, TSelected>\nexport function injectQueuedValue<\n TValue,\n TSelected extends Pick<QueuerState<TValue>, 'items'> = Pick<\n QueuerState<TValue>,\n 'items'\n >,\n>(\n value: Signal<TValue>,\n initialValue: TValue,\n options?: QueuerOptions<TValue>,\n selector?: (state: QueuerState<TValue>) => TSelected,\n): QueuedSignal<TValue, TSelected>\nexport function injectQueuedValue<\n TValue,\n TSelected extends Pick<QueuerState<TValue>, 'items'> = Pick<\n QueuerState<TValue>,\n 'items'\n >,\n>(\n value: Signal<TValue>,\n initialValueOrOptions?: TValue | QueuerOptions<TValue>,\n initialOptionsOrSelector?:\n QueuerOptions<TValue> | ((state: QueuerState<TValue>) => TSelected),\n maybeSelector?: (state: QueuerState<TValue>) => TSelected,\n): QueuedSignal<TValue, TSelected> {\n const hasSelector = typeof initialOptionsOrSelector === 'function'\n const hasInitialValue =\n (initialOptionsOrSelector !== undefined && !hasSelector) ||\n maybeSelector !== undefined\n\n const initialValue = hasInitialValue\n ? (initialValueOrOptions as TValue)\n : value()\n const initialOptions = hasInitialValue\n ? (initialOptionsOrSelector as QueuerOptions<TValue>)\n : (initialValueOrOptions as QueuerOptions<TValue>)\n const selector = hasInitialValue\n ? maybeSelector\n : (initialOptionsOrSelector as\n ((state: QueuerState<TValue>) => TSelected) | undefined)\n\n const linkedValue = linkedSignal(() => value())\n const queuedValue = signal<TValue>(initialValue)\n\n const queued = injectQueuedSignal(\n (item) => {\n queuedValue.set(item)\n },\n initialOptions,\n selector,\n )\n\n effect(() => {\n queued.addItem(linkedValue())\n })\n\n return queued\n}\n"],"mappings":";;;;AAqDA,SAAgB,kBAOd,OACA,uBACA,0BAEA,eACiC;CAEjC,MAAM,kBACH,6BAA6B,UAAa,EAFzB,OAAO,6BAA6B,eAGtD,kBAAkB;CAEpB,MAAM,eAAe,kBAChB,wBACD,MAAM;CACV,MAAM,iBAAiB,kBAClB,2BACA;CACL,MAAM,WAAW,kBACb,gBACC;CAGL,MAAM,kBAAcA,kCAAmB,MAAM,CAAC;CAC9C,MAAM,kBAAcC,sBAAe,YAAY;CAE/C,MAAM,SAASC,+CACZ,SAAS;EACR,YAAY,IAAI,IAAI;CACtB,GACA,gBACA,QACF;CAEA,gCAAa;EACX,OAAO,QAAQ,YAAY,CAAC;CAC9B,CAAC;CAED,OAAO;AACT"}
@@ -1,33 +0,0 @@
1
- import { QueuedSignal } from "./injectQueuedSignal.cjs";
2
- import { Signal } from "@angular/core";
3
- import { QueuerOptions, QueuerState } from "@tanstack/pacer/queuer";
4
- //#region src/queuer/injectQueuedValue.d.ts
5
- /**
6
- * An Angular function that creates a queued value that processes state changes in order with an optional delay.
7
- * This function uses injectQueuedSignal internally to manage a queue of state changes and apply them sequentially.
8
- *
9
- * The queued value will process changes in the order they are received, with optional delays between
10
- * processing each change. This is useful for handling state updates that need to be processed
11
- * in a specific order, like animations or sequential UI updates.
12
- *
13
- * The function returns a tuple containing:
14
- * - A Signal that provides the current queued value
15
- * - The queuer instance with control methods
16
- *
17
- * @example
18
- * ```ts
19
- * const initialValue = signal('initial')
20
- * const queued = injectQueuedValue(initialValue, {
21
- * wait: 500,
22
- * started: true,
23
- * })
24
- *
25
- * // Add changes to the queue
26
- * queued.addItem('new value')
27
- * ```
28
- */
29
- 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
- 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
32
- export { injectQueuedValue };
33
- //# sourceMappingURL=injectQueuedValue.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"injectQueuedValue.js","names":[],"sources":["../../src/queuer/injectQueuedValue.ts"],"sourcesContent":["import { effect, linkedSignal, signal } from '@angular/core'\nimport { injectQueuedSignal } from './injectQueuedSignal'\nimport type { QueuedSignal } from './injectQueuedSignal'\nimport type { Signal } from '@angular/core'\nimport type { QueuerOptions, QueuerState } from '@tanstack/pacer/queuer'\n\n/**\n * An Angular function that creates a queued value that processes state changes in order with an optional delay.\n * This function uses injectQueuedSignal internally to manage a queue of state changes and apply them sequentially.\n *\n * The queued value will process changes in the order they are received, with optional delays between\n * processing each change. This is useful for handling state updates that need to be processed\n * in a specific order, like animations or sequential UI updates.\n *\n * The function returns a tuple containing:\n * - A Signal that provides the current queued value\n * - The queuer instance with control methods\n *\n * @example\n * ```ts\n * const initialValue = signal('initial')\n * const queued = injectQueuedValue(initialValue, {\n * wait: 500,\n * started: true,\n * })\n *\n * // Add changes to the queue\n * queued.addItem('new value')\n * ```\n */\nexport function injectQueuedValue<\n TValue,\n TSelected extends Pick<QueuerState<TValue>, 'items'> = Pick<\n QueuerState<TValue>,\n 'items'\n >,\n>(\n value: Signal<TValue>,\n options?: QueuerOptions<TValue>,\n selector?: (state: QueuerState<TValue>) => TSelected,\n): QueuedSignal<TValue, TSelected>\nexport function injectQueuedValue<\n TValue,\n TSelected extends Pick<QueuerState<TValue>, 'items'> = Pick<\n QueuerState<TValue>,\n 'items'\n >,\n>(\n value: Signal<TValue>,\n initialValue: TValue,\n options?: QueuerOptions<TValue>,\n selector?: (state: QueuerState<TValue>) => TSelected,\n): QueuedSignal<TValue, TSelected>\nexport function injectQueuedValue<\n TValue,\n TSelected extends Pick<QueuerState<TValue>, 'items'> = Pick<\n QueuerState<TValue>,\n 'items'\n >,\n>(\n value: Signal<TValue>,\n initialValueOrOptions?: TValue | QueuerOptions<TValue>,\n initialOptionsOrSelector?:\n QueuerOptions<TValue> | ((state: QueuerState<TValue>) => TSelected),\n maybeSelector?: (state: QueuerState<TValue>) => TSelected,\n): QueuedSignal<TValue, TSelected> {\n const hasSelector = typeof initialOptionsOrSelector === 'function'\n const hasInitialValue =\n (initialOptionsOrSelector !== undefined && !hasSelector) ||\n maybeSelector !== undefined\n\n const initialValue = hasInitialValue\n ? (initialValueOrOptions as TValue)\n : value()\n const initialOptions = hasInitialValue\n ? (initialOptionsOrSelector as QueuerOptions<TValue>)\n : (initialValueOrOptions as QueuerOptions<TValue>)\n const selector = hasInitialValue\n ? maybeSelector\n : (initialOptionsOrSelector as\n ((state: QueuerState<TValue>) => TSelected) | undefined)\n\n const linkedValue = linkedSignal(() => value())\n const queuedValue = signal<TValue>(initialValue)\n\n const queued = injectQueuedSignal(\n (item) => {\n queuedValue.set(item)\n },\n initialOptions,\n selector,\n )\n\n effect(() => {\n queued.addItem(linkedValue())\n })\n\n return queued\n}\n"],"mappings":";;;;AAqDA,SAAgB,kBAOd,OACA,uBACA,0BAEA,eACiC;CAEjC,MAAM,kBACH,6BAA6B,UAAa,EAFzB,OAAO,6BAA6B,eAGtD,kBAAkB;CAEpB,MAAM,eAAe,kBAChB,wBACD,MAAM;CACV,MAAM,iBAAiB,kBAClB,2BACA;CACL,MAAM,WAAW,kBACb,gBACC;CAGL,MAAM,cAAc,mBAAmB,MAAM,CAAC;CAC9C,MAAM,cAAc,OAAe,YAAY;CAE/C,MAAM,SAAS,oBACZ,SAAS;EACR,YAAY,IAAI,IAAI;CACtB,GACA,gBACA,QACF;CAEA,aAAa;EACX,OAAO,QAAQ,YAAY,CAAC;CAC9B,CAAC;CAED,OAAO;AACT"}
@@ -1,80 +0,0 @@
1
- const require_pacer_context = require('../provider/pacer-context.cjs');
2
- let _angular_core = require("@angular/core");
3
- let _tanstack_angular_store = require("@tanstack/angular-store");
4
- let _tanstack_pacer_queuer = require("@tanstack/pacer/queuer");
5
-
6
- //#region src/queuer/injectQueuer.ts
7
- /**
8
- * An Angular function that creates and manages a Queuer instance.
9
- *
10
- * This is a lower-level function that provides direct access to the Queuer's functionality.
11
- * This allows you to integrate it with any state management solution you prefer.
12
- *
13
- * The Queuer processes items synchronously in order, with optional delays between processing each item.
14
- * The queuer includes an internal tick mechanism that can be started and stopped, making it useful as a scheduler.
15
- *
16
- * ## State Management and Selector
17
- *
18
- * The function uses TanStack Store for state management and wraps it with Angular signals.
19
- * The `selector` parameter allows you to specify which state changes will trigger signal updates,
20
- * optimizing performance by preventing unnecessary updates when irrelevant state changes occur.
21
- *
22
- * **By default, there will be no reactive state subscriptions** and you must opt-in to state
23
- * tracking by providing a selector function. This prevents unnecessary updates and gives you
24
- * full control over when your component tracks state changes.
25
- *
26
- * @example
27
- * ```ts
28
- * // Default behavior - no reactive state subscriptions
29
- * const queue = injectQueuer(
30
- * (item) => console.log('Processing:', item),
31
- * { started: true, wait: 1000 }
32
- * );
33
- *
34
- * // Opt-in to track queue contents changes
35
- * const queue = injectQueuer(
36
- * (item) => console.log('Processing:', item),
37
- * { started: true, wait: 1000 },
38
- * (state) => ({ items: state.items, size: state.size })
39
- * );
40
- *
41
- * // Add items
42
- * queue.addItem('task1');
43
- *
44
- * // Access the selected state
45
- * const { items, isRunning } = queue.state();
46
- * ```
47
- *
48
- * ## Cleanup on Destroy
49
- *
50
- * By default, the function stops the queuer when the component is destroyed.
51
- * Use the `onUnmount` option to customize this. For example, to flush pending items instead:
52
- *
53
- * ```ts
54
- * const queue = injectQueuer(fn, {
55
- * started: true,
56
- * onUnmount: (q) => q.flush()
57
- * });
58
- * ```
59
- */
60
- function injectQueuer(fn, options = {}, selector = () => ({})) {
61
- const mergedOptions = {
62
- ...require_pacer_context.injectPacerOptions().queuer,
63
- ...options
64
- };
65
- const queuer = new _tanstack_pacer_queuer.Queuer(fn, mergedOptions);
66
- const state = (0, _tanstack_angular_store.injectSelector)(queuer.store, selector);
67
- const result = {
68
- ...queuer,
69
- state
70
- };
71
- (0, _angular_core.inject)(_angular_core.DestroyRef, { optional: true })?.onDestroy(() => {
72
- if (mergedOptions.onUnmount) mergedOptions.onUnmount(result);
73
- else queuer.stop();
74
- });
75
- return result;
76
- }
77
-
78
- //#endregion
79
- exports.injectQueuer = injectQueuer;
80
- //# sourceMappingURL=injectQueuer.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"injectQueuer.cjs","names":["injectPacerOptions","Queuer","injectSelector","inject","DestroyRef"],"sources":["../../src/queuer/injectQueuer.ts"],"sourcesContent":["import { DestroyRef, inject } from '@angular/core'\nimport { injectSelector } from '@tanstack/angular-store'\nimport { Queuer } from '@tanstack/pacer/queuer'\nimport { injectPacerOptions } from '../provider/pacer-context'\nimport type { Signal } from '@angular/core'\nimport type { Store } from '@tanstack/angular-store'\nimport type { QueuerOptions, QueuerState } from '@tanstack/pacer/queuer'\n\nexport interface AngularQueuerOptions<\n TValue,\n TSelected = {},\n> extends QueuerOptions<TValue> {\n /**\n * Optional callback invoked when the component is destroyed. Receives the queuer instance.\n * When provided, replaces the default cleanup (stop); use it to call flush(), stop(), add logging, etc.\n */\n onUnmount?: (queuer: AngularQueuer<TValue, TSelected>) => void\n}\n\nexport interface AngularQueuer<TValue, TSelected = {}> extends Omit<\n Queuer<TValue>,\n 'store'\n> {\n /**\n * Reactive state signal that will be updated when the queuer state changes\n *\n * Use this instead of `queuer.store.state`\n */\n readonly state: Signal<Readonly<TSelected>>\n /**\n * @deprecated Use `queuer.state` instead of `queuer.store.state` if you want to read reactive state.\n * The state on the store object is not reactive in Angular signals.\n */\n readonly store: Store<Readonly<QueuerState<TValue>>>\n}\n\n/**\n * An Angular function that creates and manages a Queuer instance.\n *\n * This is a lower-level function that provides direct access to the Queuer's functionality.\n * This allows you to integrate it with any state management solution you prefer.\n *\n * The Queuer processes items synchronously in order, with optional delays between processing each item.\n * The queuer includes an internal tick mechanism that can be started and stopped, making it useful as a scheduler.\n *\n * ## State Management and Selector\n *\n * The function uses TanStack Store for state management and wraps it with Angular signals.\n * The `selector` parameter allows you to specify which state changes will trigger signal updates,\n * optimizing performance by preventing unnecessary updates when irrelevant state changes occur.\n *\n * **By default, there will be no reactive state subscriptions** and you must opt-in to state\n * tracking by providing a selector function. This prevents unnecessary updates and gives you\n * full control over when your component tracks state changes.\n *\n * @example\n * ```ts\n * // Default behavior - no reactive state subscriptions\n * const queue = injectQueuer(\n * (item) => console.log('Processing:', item),\n * { started: true, wait: 1000 }\n * );\n *\n * // Opt-in to track queue contents changes\n * const queue = injectQueuer(\n * (item) => console.log('Processing:', item),\n * { started: true, wait: 1000 },\n * (state) => ({ items: state.items, size: state.size })\n * );\n *\n * // Add items\n * queue.addItem('task1');\n *\n * // Access the selected state\n * const { items, isRunning } = queue.state();\n * ```\n *\n * ## Cleanup on Destroy\n *\n * By default, the function stops the queuer when the component is destroyed.\n * Use the `onUnmount` option to customize this. For example, to flush pending items instead:\n *\n * ```ts\n * const queue = injectQueuer(fn, {\n * started: true,\n * onUnmount: (q) => q.flush()\n * });\n * ```\n */\nexport function injectQueuer<TValue, TSelected = {}>(\n fn: (item: TValue) => void,\n options: AngularQueuerOptions<TValue, TSelected> = {},\n selector: (state: QueuerState<TValue>) => TSelected = () => ({}) as TSelected,\n): AngularQueuer<TValue, TSelected> {\n const mergedOptions = {\n ...injectPacerOptions().queuer,\n ...options,\n } as AngularQueuerOptions<TValue, TSelected>\n\n const queuer = new Queuer<TValue>(fn, mergedOptions)\n const state = injectSelector(queuer.store, selector)\n\n const result = {\n ...queuer,\n state,\n } as AngularQueuer<TValue, TSelected>\n\n const destroyRef = inject(DestroyRef, { optional: true })\n destroyRef?.onDestroy(() => {\n if (mergedOptions.onUnmount) {\n mergedOptions.onUnmount(result)\n } else {\n queuer.stop()\n }\n })\n\n return result\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyFA,SAAgB,aACd,IACA,UAAmD,CAAC,GACpD,kBAA6D,CAAC,IAC5B;CAClC,MAAM,gBAAgB;EACpB,GAAGA,yCAAmB,CAAC,CAAC;EACxB,GAAG;CACL;CAEA,MAAM,SAAS,IAAIC,8BAAe,IAAI,aAAa;CACnD,MAAM,YAAQC,wCAAe,OAAO,OAAO,QAAQ;CAEnD,MAAM,SAAS;EACb,GAAG;EACH;CACF;CAGA,IADmBC,sBAAOC,0BAAY,EAAE,UAAU,KAAK,CAC9C,CAAC,EAAE,gBAAgB;EAC1B,IAAI,cAAc,WAChB,cAAc,UAAU,MAAM;OAE9B,OAAO,KAAK;CAEhB,CAAC;CAED,OAAO;AACT"}
@@ -1,81 +0,0 @@
1
- import { Signal } from "@angular/core";
2
- import { Store } from "@tanstack/angular-store";
3
- import { Queuer, QueuerOptions, QueuerState } from "@tanstack/pacer/queuer";
4
- //#region src/queuer/injectQueuer.d.ts
5
- interface AngularQueuerOptions<TValue, TSelected = {}> extends QueuerOptions<TValue> {
6
- /**
7
- * Optional callback invoked when the component is destroyed. Receives the queuer instance.
8
- * When provided, replaces the default cleanup (stop); use it to call flush(), stop(), add logging, etc.
9
- */
10
- onUnmount?: (queuer: AngularQueuer<TValue, TSelected>) => void;
11
- }
12
- interface AngularQueuer<TValue, TSelected = {}> extends Omit<Queuer<TValue>, 'store'> {
13
- /**
14
- * Reactive state signal that will be updated when the queuer state changes
15
- *
16
- * Use this instead of `queuer.store.state`
17
- */
18
- readonly state: Signal<Readonly<TSelected>>;
19
- /**
20
- * @deprecated Use `queuer.state` instead of `queuer.store.state` if you want to read reactive state.
21
- * The state on the store object is not reactive in Angular signals.
22
- */
23
- readonly store: Store<Readonly<QueuerState<TValue>>>;
24
- }
25
- /**
26
- * An Angular function that creates and manages a Queuer instance.
27
- *
28
- * This is a lower-level function that provides direct access to the Queuer's functionality.
29
- * This allows you to integrate it with any state management solution you prefer.
30
- *
31
- * The Queuer processes items synchronously in order, with optional delays between processing each item.
32
- * The queuer includes an internal tick mechanism that can be started and stopped, making it useful as a scheduler.
33
- *
34
- * ## State Management and Selector
35
- *
36
- * The function uses TanStack Store for state management and wraps it with Angular signals.
37
- * The `selector` parameter allows you to specify which state changes will trigger signal updates,
38
- * optimizing performance by preventing unnecessary updates when irrelevant state changes occur.
39
- *
40
- * **By default, there will be no reactive state subscriptions** and you must opt-in to state
41
- * tracking by providing a selector function. This prevents unnecessary updates and gives you
42
- * full control over when your component tracks state changes.
43
- *
44
- * @example
45
- * ```ts
46
- * // Default behavior - no reactive state subscriptions
47
- * const queue = injectQueuer(
48
- * (item) => console.log('Processing:', item),
49
- * { started: true, wait: 1000 }
50
- * );
51
- *
52
- * // Opt-in to track queue contents changes
53
- * const queue = injectQueuer(
54
- * (item) => console.log('Processing:', item),
55
- * { started: true, wait: 1000 },
56
- * (state) => ({ items: state.items, size: state.size })
57
- * );
58
- *
59
- * // Add items
60
- * queue.addItem('task1');
61
- *
62
- * // Access the selected state
63
- * const { items, isRunning } = queue.state();
64
- * ```
65
- *
66
- * ## Cleanup on Destroy
67
- *
68
- * By default, the function stops the queuer when the component is destroyed.
69
- * Use the `onUnmount` option to customize this. For example, to flush pending items instead:
70
- *
71
- * ```ts
72
- * const queue = injectQueuer(fn, {
73
- * started: true,
74
- * onUnmount: (q) => q.flush()
75
- * });
76
- * ```
77
- */
78
- declare function injectQueuer<TValue, TSelected = {}>(fn: (item: TValue) => void, options?: AngularQueuerOptions<TValue, TSelected>, selector?: (state: QueuerState<TValue>) => TSelected): AngularQueuer<TValue, TSelected>;
79
- //#endregion
80
- export { AngularQueuer, AngularQueuerOptions, injectQueuer };
81
- //# sourceMappingURL=injectQueuer.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"injectQueuer.js","names":[],"sources":["../../src/queuer/injectQueuer.ts"],"sourcesContent":["import { DestroyRef, inject } from '@angular/core'\nimport { injectSelector } from '@tanstack/angular-store'\nimport { Queuer } from '@tanstack/pacer/queuer'\nimport { injectPacerOptions } from '../provider/pacer-context'\nimport type { Signal } from '@angular/core'\nimport type { Store } from '@tanstack/angular-store'\nimport type { QueuerOptions, QueuerState } from '@tanstack/pacer/queuer'\n\nexport interface AngularQueuerOptions<\n TValue,\n TSelected = {},\n> extends QueuerOptions<TValue> {\n /**\n * Optional callback invoked when the component is destroyed. Receives the queuer instance.\n * When provided, replaces the default cleanup (stop); use it to call flush(), stop(), add logging, etc.\n */\n onUnmount?: (queuer: AngularQueuer<TValue, TSelected>) => void\n}\n\nexport interface AngularQueuer<TValue, TSelected = {}> extends Omit<\n Queuer<TValue>,\n 'store'\n> {\n /**\n * Reactive state signal that will be updated when the queuer state changes\n *\n * Use this instead of `queuer.store.state`\n */\n readonly state: Signal<Readonly<TSelected>>\n /**\n * @deprecated Use `queuer.state` instead of `queuer.store.state` if you want to read reactive state.\n * The state on the store object is not reactive in Angular signals.\n */\n readonly store: Store<Readonly<QueuerState<TValue>>>\n}\n\n/**\n * An Angular function that creates and manages a Queuer instance.\n *\n * This is a lower-level function that provides direct access to the Queuer's functionality.\n * This allows you to integrate it with any state management solution you prefer.\n *\n * The Queuer processes items synchronously in order, with optional delays between processing each item.\n * The queuer includes an internal tick mechanism that can be started and stopped, making it useful as a scheduler.\n *\n * ## State Management and Selector\n *\n * The function uses TanStack Store for state management and wraps it with Angular signals.\n * The `selector` parameter allows you to specify which state changes will trigger signal updates,\n * optimizing performance by preventing unnecessary updates when irrelevant state changes occur.\n *\n * **By default, there will be no reactive state subscriptions** and you must opt-in to state\n * tracking by providing a selector function. This prevents unnecessary updates and gives you\n * full control over when your component tracks state changes.\n *\n * @example\n * ```ts\n * // Default behavior - no reactive state subscriptions\n * const queue = injectQueuer(\n * (item) => console.log('Processing:', item),\n * { started: true, wait: 1000 }\n * );\n *\n * // Opt-in to track queue contents changes\n * const queue = injectQueuer(\n * (item) => console.log('Processing:', item),\n * { started: true, wait: 1000 },\n * (state) => ({ items: state.items, size: state.size })\n * );\n *\n * // Add items\n * queue.addItem('task1');\n *\n * // Access the selected state\n * const { items, isRunning } = queue.state();\n * ```\n *\n * ## Cleanup on Destroy\n *\n * By default, the function stops the queuer when the component is destroyed.\n * Use the `onUnmount` option to customize this. For example, to flush pending items instead:\n *\n * ```ts\n * const queue = injectQueuer(fn, {\n * started: true,\n * onUnmount: (q) => q.flush()\n * });\n * ```\n */\nexport function injectQueuer<TValue, TSelected = {}>(\n fn: (item: TValue) => void,\n options: AngularQueuerOptions<TValue, TSelected> = {},\n selector: (state: QueuerState<TValue>) => TSelected = () => ({}) as TSelected,\n): AngularQueuer<TValue, TSelected> {\n const mergedOptions = {\n ...injectPacerOptions().queuer,\n ...options,\n } as AngularQueuerOptions<TValue, TSelected>\n\n const queuer = new Queuer<TValue>(fn, mergedOptions)\n const state = injectSelector(queuer.store, selector)\n\n const result = {\n ...queuer,\n state,\n } as AngularQueuer<TValue, TSelected>\n\n const destroyRef = inject(DestroyRef, { optional: true })\n destroyRef?.onDestroy(() => {\n if (mergedOptions.onUnmount) {\n mergedOptions.onUnmount(result)\n } else {\n queuer.stop()\n }\n })\n\n return result\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyFA,SAAgB,aACd,IACA,UAAmD,CAAC,GACpD,kBAA6D,CAAC,IAC5B;CAClC,MAAM,gBAAgB;EACpB,GAAG,mBAAmB,CAAC,CAAC;EACxB,GAAG;CACL;CAEA,MAAM,SAAS,IAAI,OAAe,IAAI,aAAa;CACnD,MAAM,QAAQ,eAAe,OAAO,OAAO,QAAQ;CAEnD,MAAM,SAAS;EACb,GAAG;EACH;CACF;CAGA,AADmB,OAAO,YAAY,EAAE,UAAU,KAAK,CAC9C,CAAC,EAAE,gBAAgB;EAC1B,IAAI,cAAc,WAChB,cAAc,UAAU,MAAM;OAE9B,OAAO,KAAK;CAEhB,CAAC;CAED,OAAO;AACT"}
@@ -1,17 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_injectRateLimiter = require('./injectRateLimiter.cjs');
3
- const require_injectRateLimitedCallback = require('./injectRateLimitedCallback.cjs');
4
- const require_injectRateLimitedSignal = require('./injectRateLimitedSignal.cjs');
5
- const require_injectRateLimitedValue = require('./injectRateLimitedValue.cjs');
6
-
7
- exports.injectRateLimitedCallback = require_injectRateLimitedCallback.injectRateLimitedCallback;
8
- exports.injectRateLimitedSignal = require_injectRateLimitedSignal.injectRateLimitedSignal;
9
- exports.injectRateLimitedValue = require_injectRateLimitedValue.injectRateLimitedValue;
10
- exports.injectRateLimiter = require_injectRateLimiter.injectRateLimiter;
11
- var _tanstack_pacer_rate_limiter = require("@tanstack/pacer/rate-limiter");
12
- Object.keys(_tanstack_pacer_rate_limiter).forEach(function (k) {
13
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
14
- enumerable: true,
15
- get: function () { return _tanstack_pacer_rate_limiter[k]; }
16
- });
17
- });
@@ -1,6 +0,0 @@
1
- import { injectRateLimitedCallback } from "./injectRateLimitedCallback.cjs";
2
- import { AngularRateLimiter, AngularRateLimiterOptions, injectRateLimiter } from "./injectRateLimiter.cjs";
3
- import { RateLimitedSignal, injectRateLimitedSignal } from "./injectRateLimitedSignal.cjs";
4
- import { injectRateLimitedValue } from "./injectRateLimitedValue.cjs";
5
- export * from "@tanstack/pacer/rate-limiter";
6
- export { AngularRateLimiter, AngularRateLimiterOptions, RateLimitedSignal, injectRateLimitedCallback, injectRateLimitedSignal, injectRateLimitedValue, injectRateLimiter };
@@ -1,45 +0,0 @@
1
- const require_injectRateLimiter = require('./injectRateLimiter.cjs');
2
-
3
- //#region src/rate-limiter/injectRateLimitedCallback.ts
4
- /**
5
- * An Angular function that creates a rate-limited version of a callback function.
6
- * This function is essentially a wrapper around `injectRateLimiter` that provides
7
- * a simplified API for basic rate limiting needs.
8
- *
9
- * Rate limiting is a simple "hard limit" approach - it allows all calls until the limit
10
- * is reached, then blocks subsequent calls until the window resets. Unlike throttling
11
- * or debouncing, it does not attempt to space out or intelligently collapse calls.
12
- *
13
- * This function provides a simpler API compared to `injectRateLimiter`, making it ideal for basic
14
- * rate limiting needs. However, it does not expose the underlying RateLimiter instance.
15
- *
16
- * For advanced usage requiring features like:
17
- * - Manual cancellation/reset
18
- * - Access to execution counts
19
- * - State tracking
20
- *
21
- * Consider using the `injectRateLimiter` function instead.
22
- *
23
- * @example
24
- * ```ts
25
- * // Rate limit API calls to maximum 5 calls per minute
26
- * const makeApiCall = injectRateLimitedCallback(
27
- * (data: ApiData) => {
28
- * return fetch('/api/endpoint', { method: 'POST', body: JSON.stringify(data) });
29
- * },
30
- * {
31
- * limit: 5,
32
- * window: 60000, // 1 minute
33
- * windowType: 'sliding',
34
- * }
35
- * );
36
- * ```
37
- */
38
- function injectRateLimitedCallback(fn, options) {
39
- const rateLimiter = require_injectRateLimiter.injectRateLimiter(fn, options);
40
- return (...args) => rateLimiter.maybeExecute(...args);
41
- }
42
-
43
- //#endregion
44
- exports.injectRateLimitedCallback = injectRateLimitedCallback;
45
- //# sourceMappingURL=injectRateLimitedCallback.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"injectRateLimitedCallback.cjs","names":["injectRateLimiter"],"sources":["../../src/rate-limiter/injectRateLimitedCallback.ts"],"sourcesContent":["import { injectRateLimiter } from './injectRateLimiter'\nimport type { RateLimiterOptions } from '@tanstack/pacer/rate-limiter'\nimport type { AnyFunction } from '@tanstack/pacer/types'\n\n/**\n * An Angular function that creates a rate-limited version of a callback function.\n * This function is essentially a wrapper around `injectRateLimiter` that provides\n * a simplified API for basic rate limiting needs.\n *\n * Rate limiting is a simple \"hard limit\" approach - it allows all calls until the limit\n * is reached, then blocks subsequent calls until the window resets. Unlike throttling\n * or debouncing, it does not attempt to space out or intelligently collapse calls.\n *\n * This function provides a simpler API compared to `injectRateLimiter`, making it ideal for basic\n * rate limiting needs. However, it does not expose the underlying RateLimiter instance.\n *\n * For advanced usage requiring features like:\n * - Manual cancellation/reset\n * - Access to execution counts\n * - State tracking\n *\n * Consider using the `injectRateLimiter` function instead.\n *\n * @example\n * ```ts\n * // Rate limit API calls to maximum 5 calls per minute\n * const makeApiCall = injectRateLimitedCallback(\n * (data: ApiData) => {\n * return fetch('/api/endpoint', { method: 'POST', body: JSON.stringify(data) });\n * },\n * {\n * limit: 5,\n * window: 60000, // 1 minute\n * windowType: 'sliding',\n * }\n * );\n * ```\n */\nexport function injectRateLimitedCallback<TFn extends AnyFunction>(\n fn: TFn,\n options: RateLimiterOptions<TFn>,\n): (...args: Parameters<TFn>) => boolean {\n const rateLimiter = injectRateLimiter(fn, options)\n return (...args: Parameters<TFn>) => rateLimiter.maybeExecute(...args)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,SAAgB,0BACd,IACA,SACuC;CACvC,MAAM,cAAcA,4CAAkB,IAAI,OAAO;CACjD,QAAQ,GAAG,SAA0B,YAAY,aAAa,GAAG,IAAI;AACvE"}