@tanstack/solid-pacer 0.15.3 → 0.16.1

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 (320) hide show
  1. package/README.md +165 -0
  2. package/dist/async-batcher/createAsyncBatcher.cjs +122 -0
  3. package/dist/async-batcher/createAsyncBatcher.cjs.map +1 -0
  4. package/dist/{cjs/async-batcher → async-batcher}/createAsyncBatcher.d.cts +22 -17
  5. package/dist/{esm/async-batcher → async-batcher}/createAsyncBatcher.d.ts +22 -17
  6. package/dist/async-batcher/createAsyncBatcher.js +122 -0
  7. package/dist/async-batcher/createAsyncBatcher.js.map +1 -0
  8. package/dist/async-batcher/index.cjs +10 -0
  9. package/dist/async-batcher/index.d.cts +3 -0
  10. package/dist/async-batcher/index.d.ts +3 -0
  11. package/dist/async-batcher/index.js +5 -0
  12. package/dist/async-debouncer/createAsyncDebouncer.cjs +114 -0
  13. package/dist/async-debouncer/createAsyncDebouncer.cjs.map +1 -0
  14. package/dist/{cjs/async-debouncer → async-debouncer}/createAsyncDebouncer.d.cts +23 -18
  15. package/dist/{esm/async-debouncer → async-debouncer}/createAsyncDebouncer.d.ts +23 -18
  16. package/dist/async-debouncer/createAsyncDebouncer.js +114 -0
  17. package/dist/async-debouncer/createAsyncDebouncer.js.map +1 -0
  18. package/dist/async-debouncer/index.cjs +10 -0
  19. package/dist/async-debouncer/index.d.cts +3 -0
  20. package/dist/async-debouncer/index.d.ts +3 -0
  21. package/dist/async-debouncer/index.js +5 -0
  22. package/dist/async-queuer/createAsyncQueuer.cjs +114 -0
  23. package/dist/async-queuer/createAsyncQueuer.cjs.map +1 -0
  24. package/dist/{cjs/async-queuer → async-queuer}/createAsyncQueuer.d.cts +22 -17
  25. package/dist/{esm/async-queuer → async-queuer}/createAsyncQueuer.d.ts +22 -17
  26. package/dist/async-queuer/createAsyncQueuer.js +114 -0
  27. package/dist/async-queuer/createAsyncQueuer.js.map +1 -0
  28. package/dist/async-queuer/index.cjs +10 -0
  29. package/dist/async-queuer/index.d.cts +3 -0
  30. package/dist/async-queuer/index.d.ts +3 -0
  31. package/dist/async-queuer/index.js +5 -0
  32. package/dist/async-rate-limiter/createAsyncRateLimiter.cjs +120 -0
  33. package/dist/async-rate-limiter/createAsyncRateLimiter.cjs.map +1 -0
  34. package/dist/{cjs/async-rate-limiter → async-rate-limiter}/createAsyncRateLimiter.d.cts +23 -18
  35. package/dist/{esm/async-rate-limiter → async-rate-limiter}/createAsyncRateLimiter.d.ts +23 -18
  36. package/dist/async-rate-limiter/createAsyncRateLimiter.js +120 -0
  37. package/dist/async-rate-limiter/createAsyncRateLimiter.js.map +1 -0
  38. package/dist/async-rate-limiter/index.cjs +10 -0
  39. package/dist/async-rate-limiter/index.d.cts +3 -0
  40. package/dist/async-rate-limiter/index.d.ts +3 -0
  41. package/dist/async-rate-limiter/index.js +5 -0
  42. package/dist/async-throttler/createAsyncThrottler.cjs +108 -0
  43. package/dist/async-throttler/createAsyncThrottler.cjs.map +1 -0
  44. package/dist/{cjs/async-throttler → async-throttler}/createAsyncThrottler.d.cts +23 -18
  45. package/dist/{esm/async-throttler → async-throttler}/createAsyncThrottler.d.ts +23 -18
  46. package/dist/async-throttler/createAsyncThrottler.js +108 -0
  47. package/dist/async-throttler/createAsyncThrottler.js.map +1 -0
  48. package/dist/async-throttler/index.cjs +10 -0
  49. package/dist/async-throttler/index.d.cts +3 -0
  50. package/dist/async-throttler/index.d.ts +3 -0
  51. package/dist/async-throttler/index.js +5 -0
  52. package/dist/batcher/createBatcher.cjs +97 -0
  53. package/dist/batcher/createBatcher.cjs.map +1 -0
  54. package/dist/{cjs/batcher → batcher}/createBatcher.d.cts +22 -17
  55. package/dist/{esm/batcher → batcher}/createBatcher.d.ts +22 -17
  56. package/dist/batcher/createBatcher.js +97 -0
  57. package/dist/batcher/createBatcher.js.map +1 -0
  58. package/dist/batcher/index.cjs +10 -0
  59. package/dist/batcher/index.d.cts +3 -0
  60. package/dist/batcher/index.d.ts +3 -0
  61. package/dist/batcher/index.js +5 -0
  62. package/dist/debouncer/createDebouncedSignal.cjs +88 -0
  63. package/dist/debouncer/createDebouncedSignal.cjs.map +1 -0
  64. package/dist/{cjs/debouncer → debouncer}/createDebouncedSignal.d.cts +10 -8
  65. package/dist/{esm/debouncer → debouncer}/createDebouncedSignal.d.ts +10 -8
  66. package/dist/debouncer/createDebouncedSignal.js +88 -0
  67. package/dist/debouncer/createDebouncedSignal.js.map +1 -0
  68. package/dist/debouncer/createDebouncedValue.cjs +77 -0
  69. package/dist/debouncer/createDebouncedValue.cjs.map +1 -0
  70. package/dist/{cjs/debouncer → debouncer}/createDebouncedValue.d.cts +10 -4
  71. package/dist/{esm/debouncer → debouncer}/createDebouncedValue.d.ts +10 -4
  72. package/dist/debouncer/createDebouncedValue.js +77 -0
  73. package/dist/debouncer/createDebouncedValue.js.map +1 -0
  74. package/dist/debouncer/createDebouncer.cjs +101 -0
  75. package/dist/debouncer/createDebouncer.cjs.map +1 -0
  76. package/dist/{cjs/debouncer → debouncer}/createDebouncer.d.cts +23 -18
  77. package/dist/{esm/debouncer → debouncer}/createDebouncer.d.ts +23 -18
  78. package/dist/debouncer/createDebouncer.js +101 -0
  79. package/dist/debouncer/createDebouncer.js.map +1 -0
  80. package/dist/debouncer/index.cjs +14 -0
  81. package/dist/debouncer/index.d.cts +5 -0
  82. package/dist/debouncer/index.d.ts +5 -0
  83. package/dist/{esm/debouncer → debouncer}/index.js +5 -8
  84. package/dist/index.cjs +46 -0
  85. package/dist/index.d.cts +20 -0
  86. package/dist/index.d.ts +20 -0
  87. package/dist/{esm/index.js → index.js} +8 -22
  88. package/dist/provider/PacerProvider.cjs +27 -0
  89. package/dist/provider/PacerProvider.cjs.map +1 -0
  90. package/dist/provider/PacerProvider.d.cts +29 -0
  91. package/dist/provider/PacerProvider.d.ts +29 -0
  92. package/dist/provider/PacerProvider.js +25 -0
  93. package/dist/provider/PacerProvider.js.map +1 -0
  94. package/dist/provider/index.cjs +5 -0
  95. package/dist/provider/index.d.cts +2 -0
  96. package/dist/provider/index.d.ts +2 -0
  97. package/dist/provider/index.js +3 -0
  98. package/dist/queuer/createQueuedSignal.cjs +129 -0
  99. package/dist/queuer/createQueuedSignal.cjs.map +1 -0
  100. package/dist/queuer/createQueuedSignal.d.cts +123 -0
  101. package/dist/queuer/createQueuedSignal.d.ts +123 -0
  102. package/dist/queuer/createQueuedSignal.js +129 -0
  103. package/dist/queuer/createQueuedSignal.js.map +1 -0
  104. package/dist/queuer/createQueuer.cjs +98 -0
  105. package/dist/queuer/createQueuer.cjs.map +1 -0
  106. package/dist/{cjs/queuer → queuer}/createQueuer.d.cts +22 -17
  107. package/dist/{esm/queuer → queuer}/createQueuer.d.ts +22 -17
  108. package/dist/queuer/createQueuer.js +98 -0
  109. package/dist/queuer/createQueuer.js.map +1 -0
  110. package/dist/queuer/index.cjs +12 -0
  111. package/dist/queuer/index.d.cts +4 -0
  112. package/dist/queuer/index.d.ts +4 -0
  113. package/dist/queuer/index.js +6 -0
  114. package/dist/rate-limiter/createRateLimitedSignal.cjs +102 -0
  115. package/dist/rate-limiter/createRateLimitedSignal.cjs.map +1 -0
  116. package/dist/{cjs/rate-limiter → rate-limiter}/createRateLimitedSignal.d.cts +10 -8
  117. package/dist/{esm/rate-limiter → rate-limiter}/createRateLimitedSignal.d.ts +10 -8
  118. package/dist/rate-limiter/createRateLimitedSignal.js +102 -0
  119. package/dist/rate-limiter/createRateLimitedSignal.js.map +1 -0
  120. package/dist/rate-limiter/createRateLimitedValue.cjs +102 -0
  121. package/dist/rate-limiter/createRateLimitedValue.cjs.map +1 -0
  122. package/dist/{cjs/rate-limiter → rate-limiter}/createRateLimitedValue.d.cts +40 -20
  123. package/dist/{esm/rate-limiter → rate-limiter}/createRateLimitedValue.d.ts +40 -20
  124. package/dist/rate-limiter/createRateLimitedValue.js +102 -0
  125. package/dist/rate-limiter/createRateLimitedValue.js.map +1 -0
  126. package/dist/rate-limiter/createRateLimiter.cjs +95 -0
  127. package/dist/rate-limiter/createRateLimiter.cjs.map +1 -0
  128. package/dist/{cjs/rate-limiter → rate-limiter}/createRateLimiter.d.cts +23 -18
  129. package/dist/{esm/rate-limiter → rate-limiter}/createRateLimiter.d.ts +23 -18
  130. package/dist/rate-limiter/createRateLimiter.js +95 -0
  131. package/dist/rate-limiter/createRateLimiter.js.map +1 -0
  132. package/dist/rate-limiter/index.cjs +14 -0
  133. package/dist/rate-limiter/index.d.cts +5 -0
  134. package/dist/rate-limiter/index.d.ts +5 -0
  135. package/dist/{esm/rate-limiter → rate-limiter}/index.js +4 -7
  136. package/dist/throttler/createThrottledSignal.cjs +79 -0
  137. package/dist/throttler/createThrottledSignal.cjs.map +1 -0
  138. package/dist/{cjs/throttler → throttler}/createThrottledSignal.d.cts +10 -8
  139. package/dist/{esm/throttler → throttler}/createThrottledSignal.d.ts +10 -8
  140. package/dist/throttler/createThrottledSignal.js +79 -0
  141. package/dist/throttler/createThrottledSignal.js.map +1 -0
  142. package/dist/throttler/createThrottledValue.cjs +74 -0
  143. package/dist/throttler/createThrottledValue.cjs.map +1 -0
  144. package/dist/{cjs/throttler → throttler}/createThrottledValue.d.cts +10 -4
  145. package/dist/{esm/throttler → throttler}/createThrottledValue.d.ts +10 -4
  146. package/dist/throttler/createThrottledValue.js +74 -0
  147. package/dist/throttler/createThrottledValue.js.map +1 -0
  148. package/dist/throttler/createThrottler.cjs +97 -0
  149. package/dist/throttler/createThrottler.cjs.map +1 -0
  150. package/dist/{cjs/throttler → throttler}/createThrottler.d.cts +23 -18
  151. package/dist/{esm/throttler → throttler}/createThrottler.d.ts +23 -18
  152. package/dist/throttler/createThrottler.js +97 -0
  153. package/dist/throttler/createThrottler.js.map +1 -0
  154. package/dist/throttler/index.cjs +14 -0
  155. package/dist/throttler/index.d.cts +5 -0
  156. package/dist/throttler/index.d.ts +5 -0
  157. package/dist/{esm/throttler → throttler}/index.js +5 -8
  158. package/dist/types/index.cjs +9 -0
  159. package/dist/types/index.d.cts +1 -0
  160. package/dist/types/index.d.ts +1 -0
  161. package/dist/types/index.js +3 -0
  162. package/dist/utils/index.cjs +9 -0
  163. package/dist/utils/index.d.cts +1 -0
  164. package/dist/utils/index.d.ts +1 -0
  165. package/dist/utils/index.js +3 -0
  166. package/package.json +37 -106
  167. package/src/async-batcher/createAsyncBatcher.ts +12 -4
  168. package/src/async-debouncer/createAsyncDebouncer.ts +8 -2
  169. package/src/async-queuer/createAsyncQueuer.ts +12 -4
  170. package/src/async-rate-limiter/createAsyncRateLimiter.ts +8 -2
  171. package/src/async-throttler/createAsyncThrottler.ts +8 -2
  172. package/src/batcher/createBatcher.ts +12 -4
  173. package/src/debouncer/createDebouncer.ts +12 -4
  174. package/src/index.ts +4 -0
  175. package/src/provider/PacerProvider.tsx +63 -0
  176. package/src/provider/index.ts +1 -0
  177. package/src/queuer/createQueuedSignal.ts +138 -0
  178. package/src/queuer/createQueuer.ts +12 -4
  179. package/src/queuer/index.ts +1 -0
  180. package/src/rate-limiter/createRateLimitedValue.ts +30 -16
  181. package/src/rate-limiter/createRateLimiter.ts +12 -4
  182. package/src/throttler/createThrottler.ts +12 -4
  183. package/dist/cjs/async-batcher/createAsyncBatcher.cjs +0 -14
  184. package/dist/cjs/async-batcher/createAsyncBatcher.cjs.map +0 -1
  185. package/dist/cjs/async-batcher/index.cjs +0 -12
  186. package/dist/cjs/async-batcher/index.cjs.map +0 -1
  187. package/dist/cjs/async-batcher/index.d.cts +0 -2
  188. package/dist/cjs/async-debouncer/createAsyncDebouncer.cjs +0 -20
  189. package/dist/cjs/async-debouncer/createAsyncDebouncer.cjs.map +0 -1
  190. package/dist/cjs/async-debouncer/index.cjs +0 -12
  191. package/dist/cjs/async-debouncer/index.cjs.map +0 -1
  192. package/dist/cjs/async-debouncer/index.d.cts +0 -2
  193. package/dist/cjs/async-queuer/createAsyncQueuer.cjs +0 -14
  194. package/dist/cjs/async-queuer/createAsyncQueuer.cjs.map +0 -1
  195. package/dist/cjs/async-queuer/index.cjs +0 -12
  196. package/dist/cjs/async-queuer/index.cjs.map +0 -1
  197. package/dist/cjs/async-queuer/index.d.cts +0 -2
  198. package/dist/cjs/async-rate-limiter/createAsyncRateLimiter.cjs +0 -14
  199. package/dist/cjs/async-rate-limiter/createAsyncRateLimiter.cjs.map +0 -1
  200. package/dist/cjs/async-rate-limiter/index.cjs +0 -12
  201. package/dist/cjs/async-rate-limiter/index.cjs.map +0 -1
  202. package/dist/cjs/async-rate-limiter/index.d.cts +0 -2
  203. package/dist/cjs/async-throttler/createAsyncThrottler.cjs +0 -14
  204. package/dist/cjs/async-throttler/createAsyncThrottler.cjs.map +0 -1
  205. package/dist/cjs/async-throttler/index.cjs +0 -12
  206. package/dist/cjs/async-throttler/index.cjs.map +0 -1
  207. package/dist/cjs/async-throttler/index.d.cts +0 -2
  208. package/dist/cjs/batcher/createBatcher.cjs +0 -14
  209. package/dist/cjs/batcher/createBatcher.cjs.map +0 -1
  210. package/dist/cjs/batcher/index.cjs +0 -12
  211. package/dist/cjs/batcher/index.cjs.map +0 -1
  212. package/dist/cjs/batcher/index.d.cts +0 -2
  213. package/dist/cjs/debouncer/createDebouncedSignal.cjs +0 -11
  214. package/dist/cjs/debouncer/createDebouncedSignal.cjs.map +0 -1
  215. package/dist/cjs/debouncer/createDebouncedValue.cjs +0 -17
  216. package/dist/cjs/debouncer/createDebouncedValue.cjs.map +0 -1
  217. package/dist/cjs/debouncer/createDebouncer.cjs +0 -20
  218. package/dist/cjs/debouncer/createDebouncer.cjs.map +0 -1
  219. package/dist/cjs/debouncer/index.cjs +0 -16
  220. package/dist/cjs/debouncer/index.cjs.map +0 -1
  221. package/dist/cjs/debouncer/index.d.cts +0 -4
  222. package/dist/cjs/index.cjs +0 -42
  223. package/dist/cjs/index.cjs.map +0 -1
  224. package/dist/cjs/index.d.cts +0 -20
  225. package/dist/cjs/queuer/createQueuer.cjs +0 -14
  226. package/dist/cjs/queuer/createQueuer.cjs.map +0 -1
  227. package/dist/cjs/queuer/index.cjs +0 -12
  228. package/dist/cjs/queuer/index.cjs.map +0 -1
  229. package/dist/cjs/queuer/index.d.cts +0 -2
  230. package/dist/cjs/rate-limiter/createRateLimitedSignal.cjs +0 -19
  231. package/dist/cjs/rate-limiter/createRateLimitedSignal.cjs.map +0 -1
  232. package/dist/cjs/rate-limiter/createRateLimitedValue.cjs +0 -13
  233. package/dist/cjs/rate-limiter/createRateLimitedValue.cjs.map +0 -1
  234. package/dist/cjs/rate-limiter/createRateLimiter.cjs +0 -14
  235. package/dist/cjs/rate-limiter/createRateLimiter.cjs.map +0 -1
  236. package/dist/cjs/rate-limiter/index.cjs +0 -16
  237. package/dist/cjs/rate-limiter/index.cjs.map +0 -1
  238. package/dist/cjs/rate-limiter/index.d.cts +0 -4
  239. package/dist/cjs/throttler/createThrottledSignal.cjs +0 -11
  240. package/dist/cjs/throttler/createThrottledSignal.cjs.map +0 -1
  241. package/dist/cjs/throttler/createThrottledValue.cjs +0 -17
  242. package/dist/cjs/throttler/createThrottledValue.cjs.map +0 -1
  243. package/dist/cjs/throttler/createThrottler.cjs +0 -20
  244. package/dist/cjs/throttler/createThrottler.cjs.map +0 -1
  245. package/dist/cjs/throttler/index.cjs +0 -16
  246. package/dist/cjs/throttler/index.cjs.map +0 -1
  247. package/dist/cjs/throttler/index.d.cts +0 -4
  248. package/dist/cjs/types/index.cjs +0 -10
  249. package/dist/cjs/types/index.cjs.map +0 -1
  250. package/dist/cjs/types/index.d.cts +0 -1
  251. package/dist/cjs/utils/index.cjs +0 -10
  252. package/dist/cjs/utils/index.cjs.map +0 -1
  253. package/dist/cjs/utils/index.d.cts +0 -1
  254. package/dist/esm/async-batcher/createAsyncBatcher.js +0 -14
  255. package/dist/esm/async-batcher/createAsyncBatcher.js.map +0 -1
  256. package/dist/esm/async-batcher/index.d.ts +0 -2
  257. package/dist/esm/async-batcher/index.js +0 -6
  258. package/dist/esm/async-batcher/index.js.map +0 -1
  259. package/dist/esm/async-debouncer/createAsyncDebouncer.js +0 -20
  260. package/dist/esm/async-debouncer/createAsyncDebouncer.js.map +0 -1
  261. package/dist/esm/async-debouncer/index.d.ts +0 -2
  262. package/dist/esm/async-debouncer/index.js +0 -6
  263. package/dist/esm/async-debouncer/index.js.map +0 -1
  264. package/dist/esm/async-queuer/createAsyncQueuer.js +0 -14
  265. package/dist/esm/async-queuer/createAsyncQueuer.js.map +0 -1
  266. package/dist/esm/async-queuer/index.d.ts +0 -2
  267. package/dist/esm/async-queuer/index.js +0 -6
  268. package/dist/esm/async-queuer/index.js.map +0 -1
  269. package/dist/esm/async-rate-limiter/createAsyncRateLimiter.js +0 -14
  270. package/dist/esm/async-rate-limiter/createAsyncRateLimiter.js.map +0 -1
  271. package/dist/esm/async-rate-limiter/index.d.ts +0 -2
  272. package/dist/esm/async-rate-limiter/index.js +0 -6
  273. package/dist/esm/async-rate-limiter/index.js.map +0 -1
  274. package/dist/esm/async-throttler/createAsyncThrottler.js +0 -14
  275. package/dist/esm/async-throttler/createAsyncThrottler.js.map +0 -1
  276. package/dist/esm/async-throttler/index.d.ts +0 -2
  277. package/dist/esm/async-throttler/index.js +0 -6
  278. package/dist/esm/async-throttler/index.js.map +0 -1
  279. package/dist/esm/batcher/createBatcher.js +0 -14
  280. package/dist/esm/batcher/createBatcher.js.map +0 -1
  281. package/dist/esm/batcher/index.d.ts +0 -2
  282. package/dist/esm/batcher/index.js +0 -6
  283. package/dist/esm/batcher/index.js.map +0 -1
  284. package/dist/esm/debouncer/createDebouncedSignal.js +0 -11
  285. package/dist/esm/debouncer/createDebouncedSignal.js.map +0 -1
  286. package/dist/esm/debouncer/createDebouncedValue.js +0 -17
  287. package/dist/esm/debouncer/createDebouncedValue.js.map +0 -1
  288. package/dist/esm/debouncer/createDebouncer.js +0 -20
  289. package/dist/esm/debouncer/createDebouncer.js.map +0 -1
  290. package/dist/esm/debouncer/index.d.ts +0 -4
  291. package/dist/esm/debouncer/index.js.map +0 -1
  292. package/dist/esm/index.d.ts +0 -20
  293. package/dist/esm/index.js.map +0 -1
  294. package/dist/esm/queuer/createQueuer.js +0 -14
  295. package/dist/esm/queuer/createQueuer.js.map +0 -1
  296. package/dist/esm/queuer/index.d.ts +0 -2
  297. package/dist/esm/queuer/index.js +0 -6
  298. package/dist/esm/queuer/index.js.map +0 -1
  299. package/dist/esm/rate-limiter/createRateLimitedSignal.js +0 -19
  300. package/dist/esm/rate-limiter/createRateLimitedSignal.js.map +0 -1
  301. package/dist/esm/rate-limiter/createRateLimitedValue.js +0 -13
  302. package/dist/esm/rate-limiter/createRateLimitedValue.js.map +0 -1
  303. package/dist/esm/rate-limiter/createRateLimiter.js +0 -14
  304. package/dist/esm/rate-limiter/createRateLimiter.js.map +0 -1
  305. package/dist/esm/rate-limiter/index.d.ts +0 -4
  306. package/dist/esm/rate-limiter/index.js.map +0 -1
  307. package/dist/esm/throttler/createThrottledSignal.js +0 -11
  308. package/dist/esm/throttler/createThrottledSignal.js.map +0 -1
  309. package/dist/esm/throttler/createThrottledValue.js +0 -17
  310. package/dist/esm/throttler/createThrottledValue.js.map +0 -1
  311. package/dist/esm/throttler/createThrottler.js +0 -20
  312. package/dist/esm/throttler/createThrottler.js.map +0 -1
  313. package/dist/esm/throttler/index.d.ts +0 -4
  314. package/dist/esm/throttler/index.js.map +0 -1
  315. package/dist/esm/types/index.d.ts +0 -1
  316. package/dist/esm/types/index.js +0 -2
  317. package/dist/esm/types/index.js.map +0 -1
  318. package/dist/esm/utils/index.d.ts +0 -1
  319. package/dist/esm/utils/index.js +0 -2
  320. package/dist/esm/utils/index.js.map +0 -1
@@ -0,0 +1,97 @@
1
+ const require_PacerProvider = require('../provider/PacerProvider.cjs');
2
+ let solid_js = require("solid-js");
3
+ let __tanstack_solid_store = require("@tanstack/solid-store");
4
+ let __tanstack_pacer_throttler = require("@tanstack/pacer/throttler");
5
+
6
+ //#region src/throttler/createThrottler.ts
7
+ /**
8
+ * A low-level Solid hook that creates a `Throttler` instance that limits how often the provided function can execute.
9
+ *
10
+ * This hook is designed to be flexible and state-management agnostic - it simply returns a throttler instance that
11
+ * you can integrate with any state management solution (createSignal, Redux, Zustand, Jotai, etc). For a simpler and higher-level hook that
12
+ * integrates directly with Solid's createSignal, see createThrottledSignal.
13
+ *
14
+ * Throttling ensures a function executes at most once within a specified time window,
15
+ * regardless of how many times it is called. This is useful for rate-limiting
16
+ * expensive operations or UI updates.
17
+ *
18
+ * ## State Management and Selector
19
+ *
20
+ * The hook uses TanStack Store for reactive state management. The `selector` parameter allows you
21
+ * to specify which state changes will trigger a re-render, optimizing performance by preventing
22
+ * unnecessary re-renders when irrelevant state changes occur.
23
+ *
24
+ * **By default, there will be no reactive state subscriptions** and you must opt-in to state
25
+ * tracking by providing a selector function. This prevents unnecessary re-renders and gives you
26
+ * full control over when your component updates. Only when you provide a selector will the
27
+ * component re-render when the selected state values change.
28
+ *
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
+ * - `executionCount`: Number of function executions that have been completed
33
+ * - `isPending`: Whether the throttler is waiting for the timeout to trigger execution
34
+ * - `lastArgs`: The arguments from the most recent call to maybeExecute
35
+ * - `lastExecutionTime`: Timestamp of the last execution
36
+ * - `nextExecutionTime`: Timestamp of the next allowed execution
37
+ * - `status`: Current execution status ('disabled' | 'idle' | 'pending')
38
+ *
39
+ * @example
40
+ * ```tsx
41
+ * // Default behavior - no reactive state subscriptions
42
+ * const throttler = createThrottler(setValue, { wait: 1000 });
43
+ *
44
+ * // Opt-in to re-render when isPending changes (optimized for loading states)
45
+ * const throttler = createThrottler(
46
+ * setValue,
47
+ * { wait: 1000 },
48
+ * (state) => ({ isPending: state.isPending })
49
+ * );
50
+ *
51
+ * // Opt-in to re-render when executionCount changes (optimized for tracking execution)
52
+ * const throttler = createThrottler(
53
+ * setValue,
54
+ * { wait: 1000 },
55
+ * (state) => ({ executionCount: state.executionCount })
56
+ * );
57
+ *
58
+ * // Multiple state properties - re-render when any of these change
59
+ * const throttler = createThrottler(
60
+ * setValue,
61
+ * {
62
+ * wait: 2000,
63
+ * leading: true, // Execute immediately on first call
64
+ * trailing: false // Skip trailing edge updates
65
+ * },
66
+ * (state) => ({
67
+ * isPending: state.isPending,
68
+ * executionCount: state.executionCount,
69
+ * lastExecutionTime: state.lastExecutionTime,
70
+ * nextExecutionTime: state.nextExecutionTime
71
+ * })
72
+ * );
73
+ *
74
+ * // Access the selected state (will be empty object {} unless selector provided)
75
+ * const { isPending, executionCount } = throttler.state();
76
+ * ```
77
+ */
78
+ function createThrottler(fn, options, selector = () => ({})) {
79
+ const asyncThrottler = new __tanstack_pacer_throttler.Throttler(fn, {
80
+ ...require_PacerProvider.useDefaultPacerOptions().throttler,
81
+ ...options
82
+ });
83
+ const state = (0, __tanstack_solid_store.useStore)(asyncThrottler.store, selector);
84
+ (0, solid_js.createEffect)(() => {
85
+ (0, solid_js.onCleanup)(() => {
86
+ asyncThrottler.cancel();
87
+ });
88
+ });
89
+ return {
90
+ ...asyncThrottler,
91
+ state
92
+ };
93
+ }
94
+
95
+ //#endregion
96
+ exports.createThrottler = createThrottler;
97
+ //# sourceMappingURL=createThrottler.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createThrottler.cjs","names":["Throttler","useDefaultPacerOptions"],"sources":["../../src/throttler/createThrottler.ts"],"sourcesContent":["import { Throttler } from '@tanstack/pacer/throttler'\nimport { createEffect, onCleanup } from 'solid-js'\nimport { useStore } from '@tanstack/solid-store'\nimport { useDefaultPacerOptions } from '../provider/PacerProvider'\nimport type { Store } from '@tanstack/solid-store'\nimport type { Accessor } from 'solid-js'\nimport type { AnyFunction } from '@tanstack/pacer/types'\nimport type {\n ThrottlerOptions,\n ThrottlerState,\n} from '@tanstack/pacer/throttler'\n\nexport interface SolidThrottler<\n TFn extends AnyFunction,\n TSelected = {},\n> extends Omit<Throttler<TFn>, 'store'> {\n /**\n * Reactive state that will be updated when the throttler state changes\n *\n * Use this instead of `throttler.store.state`\n */\n readonly state: Accessor<Readonly<TSelected>>\n /**\n * @deprecated Use `throttler.state` instead of `throttler.store.state` if you want to read reactive state.\n * The state on the store object is not reactive, as it has not been wrapped in a `useStore` hook internally.\n * Although, you can make the state reactive by using the `useStore` in your own usage.\n */\n readonly store: Store<Readonly<ThrottlerState<TFn>>>\n}\n\n/**\n * A low-level Solid hook that creates a `Throttler` instance that limits how often the provided function can execute.\n *\n * This hook is designed to be flexible and state-management agnostic - it simply returns a throttler instance that\n * you can integrate with any state management solution (createSignal, Redux, Zustand, Jotai, etc). For a simpler and higher-level hook that\n * integrates directly with Solid's createSignal, see createThrottledSignal.\n *\n * Throttling ensures a function executes at most once within a specified time window,\n * regardless of how many times it is called. This is useful for rate-limiting\n * expensive operations or UI updates.\n *\n * ## State Management and Selector\n *\n * The hook uses TanStack Store for reactive state management. The `selector` parameter allows you\n * to specify which state changes will trigger a re-render, optimizing performance by preventing\n * unnecessary re-renders 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 re-renders and gives you\n * full control over when your component updates. Only when you provide a selector will the\n * component re-render when the selected state values change.\n *\n * Available state properties:\n * - `canLeadingExecute`: Whether the throttler can execute on the leading edge\n * - `canTrailingExecute`: Whether the throttler can execute on the trailing edge\n * - `executionCount`: Number of function executions that have been completed\n * - `isPending`: Whether the throttler is waiting for the timeout to trigger execution\n * - `lastArgs`: The arguments from the most recent call to maybeExecute\n * - `lastExecutionTime`: Timestamp of the last execution\n * - `nextExecutionTime`: Timestamp of the next allowed execution\n * - `status`: Current execution status ('disabled' | 'idle' | 'pending')\n *\n * @example\n * ```tsx\n * // Default behavior - no reactive state subscriptions\n * const throttler = createThrottler(setValue, { wait: 1000 });\n *\n * // Opt-in to re-render when isPending changes (optimized for loading states)\n * const throttler = createThrottler(\n * setValue,\n * { wait: 1000 },\n * (state) => ({ isPending: state.isPending })\n * );\n *\n * // Opt-in to re-render when executionCount changes (optimized for tracking execution)\n * const throttler = createThrottler(\n * setValue,\n * { wait: 1000 },\n * (state) => ({ executionCount: state.executionCount })\n * );\n *\n * // Multiple state properties - re-render when any of these change\n * const throttler = createThrottler(\n * setValue,\n * {\n * wait: 2000,\n * leading: true, // Execute immediately on first call\n * trailing: false // Skip trailing edge updates\n * },\n * (state) => ({\n * isPending: state.isPending,\n * executionCount: state.executionCount,\n * lastExecutionTime: state.lastExecutionTime,\n * nextExecutionTime: state.nextExecutionTime\n * })\n * );\n *\n * // Access the selected state (will be empty object {} unless selector provided)\n * const { isPending, executionCount } = throttler.state();\n * ```\n */\nexport function createThrottler<TFn extends AnyFunction, TSelected = {}>(\n fn: TFn,\n options: ThrottlerOptions<TFn>,\n selector: (state: ThrottlerState<TFn>) => TSelected = () => ({}) as TSelected,\n): SolidThrottler<TFn, TSelected> {\n const mergedOptions = {\n ...useDefaultPacerOptions().throttler,\n ...options,\n } as ThrottlerOptions<TFn>\n\n const asyncThrottler = new Throttler<TFn>(fn, mergedOptions)\n\n const state = useStore(asyncThrottler.store, selector)\n\n createEffect(() => {\n onCleanup(() => {\n asyncThrottler.cancel()\n })\n })\n\n return {\n ...asyncThrottler,\n state,\n } as SolidThrottler<TFn, TSelected> // omit `store` in favor of `state`\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqGA,SAAgB,gBACd,IACA,SACA,kBAA6D,EAAE,GAC/B;CAMhC,MAAM,iBAAiB,IAAIA,qCAAe,IALpB;EACpB,GAAGC,8CAAwB,CAAC;EAC5B,GAAG;EACJ,CAE2D;CAE5D,MAAM,6CAAiB,eAAe,OAAO,SAAS;AAEtD,kCAAmB;AACjB,gCAAgB;AACd,kBAAe,QAAQ;IACvB;GACF;AAEF,QAAO;EACL,GAAG;EACH;EACD"}
@@ -1,20 +1,22 @@
1
- import { Throttler, ThrottlerOptions, ThrottlerState } from '@tanstack/pacer/throttler';
2
- import { Store } from '@tanstack/solid-store';
3
- import { Accessor } from 'solid-js';
4
- import { AnyFunction } from '@tanstack/pacer/types';
5
- export interface SolidThrottler<TFn extends AnyFunction, TSelected = {}> extends Omit<Throttler<TFn>, 'store'> {
6
- /**
7
- * Reactive state that will be updated when the throttler state changes
8
- *
9
- * Use this instead of `throttler.store.state`
10
- */
11
- readonly state: Accessor<Readonly<TSelected>>;
12
- /**
13
- * @deprecated Use `throttler.state` instead of `throttler.store.state` if you want to read reactive state.
14
- * The state on the store object is not reactive, as it has not been wrapped in a `useStore` hook internally.
15
- * Although, you can make the state reactive by using the `useStore` in your own usage.
16
- */
17
- readonly store: Store<Readonly<ThrottlerState<TFn>>>;
1
+ import { Store } from "@tanstack/solid-store";
2
+ import { Accessor } from "solid-js";
3
+ import { AnyFunction } from "@tanstack/pacer/types";
4
+ import { Throttler, ThrottlerOptions, ThrottlerState } from "@tanstack/pacer/throttler";
5
+
6
+ //#region src/throttler/createThrottler.d.ts
7
+ interface SolidThrottler<TFn extends AnyFunction, TSelected = {}> extends Omit<Throttler<TFn>, 'store'> {
8
+ /**
9
+ * Reactive state that will be updated when the throttler state changes
10
+ *
11
+ * Use this instead of `throttler.store.state`
12
+ */
13
+ readonly state: Accessor<Readonly<TSelected>>;
14
+ /**
15
+ * @deprecated Use `throttler.state` instead of `throttler.store.state` if you want to read reactive state.
16
+ * The state on the store object is not reactive, as it has not been wrapped in a `useStore` hook internally.
17
+ * Although, you can make the state reactive by using the `useStore` in your own usage.
18
+ */
19
+ readonly store: Store<Readonly<ThrottlerState<TFn>>>;
18
20
  }
19
21
  /**
20
22
  * A low-level Solid hook that creates a `Throttler` instance that limits how often the provided function can execute.
@@ -87,4 +89,7 @@ export interface SolidThrottler<TFn extends AnyFunction, TSelected = {}> extends
87
89
  * const { isPending, executionCount } = throttler.state();
88
90
  * ```
89
91
  */
90
- export declare function createThrottler<TFn extends AnyFunction, TSelected = {}>(fn: TFn, initialOptions: ThrottlerOptions<TFn>, selector?: (state: ThrottlerState<TFn>) => TSelected): SolidThrottler<TFn, TSelected>;
92
+ declare function createThrottler<TFn extends AnyFunction, TSelected = {}>(fn: TFn, options: ThrottlerOptions<TFn>, selector?: (state: ThrottlerState<TFn>) => TSelected): SolidThrottler<TFn, TSelected>;
93
+ //#endregion
94
+ export { SolidThrottler, createThrottler };
95
+ //# sourceMappingURL=createThrottler.d.cts.map
@@ -1,20 +1,22 @@
1
- import { Throttler, ThrottlerOptions, ThrottlerState } from '@tanstack/pacer/throttler';
2
- import { Store } from '@tanstack/solid-store';
3
- import { Accessor } from 'solid-js';
4
- import { AnyFunction } from '@tanstack/pacer/types';
5
- export interface SolidThrottler<TFn extends AnyFunction, TSelected = {}> extends Omit<Throttler<TFn>, 'store'> {
6
- /**
7
- * Reactive state that will be updated when the throttler state changes
8
- *
9
- * Use this instead of `throttler.store.state`
10
- */
11
- readonly state: Accessor<Readonly<TSelected>>;
12
- /**
13
- * @deprecated Use `throttler.state` instead of `throttler.store.state` if you want to read reactive state.
14
- * The state on the store object is not reactive, as it has not been wrapped in a `useStore` hook internally.
15
- * Although, you can make the state reactive by using the `useStore` in your own usage.
16
- */
17
- readonly store: Store<Readonly<ThrottlerState<TFn>>>;
1
+ import { Accessor } from "solid-js";
2
+ import { Store } from "@tanstack/solid-store";
3
+ import { Throttler, ThrottlerOptions, ThrottlerState } from "@tanstack/pacer/throttler";
4
+ import { AnyFunction } from "@tanstack/pacer/types";
5
+
6
+ //#region src/throttler/createThrottler.d.ts
7
+ interface SolidThrottler<TFn extends AnyFunction, TSelected = {}> extends Omit<Throttler<TFn>, 'store'> {
8
+ /**
9
+ * Reactive state that will be updated when the throttler state changes
10
+ *
11
+ * Use this instead of `throttler.store.state`
12
+ */
13
+ readonly state: Accessor<Readonly<TSelected>>;
14
+ /**
15
+ * @deprecated Use `throttler.state` instead of `throttler.store.state` if you want to read reactive state.
16
+ * The state on the store object is not reactive, as it has not been wrapped in a `useStore` hook internally.
17
+ * Although, you can make the state reactive by using the `useStore` in your own usage.
18
+ */
19
+ readonly store: Store<Readonly<ThrottlerState<TFn>>>;
18
20
  }
19
21
  /**
20
22
  * A low-level Solid hook that creates a `Throttler` instance that limits how often the provided function can execute.
@@ -87,4 +89,7 @@ export interface SolidThrottler<TFn extends AnyFunction, TSelected = {}> extends
87
89
  * const { isPending, executionCount } = throttler.state();
88
90
  * ```
89
91
  */
90
- export declare function createThrottler<TFn extends AnyFunction, TSelected = {}>(fn: TFn, initialOptions: ThrottlerOptions<TFn>, selector?: (state: ThrottlerState<TFn>) => TSelected): SolidThrottler<TFn, TSelected>;
92
+ declare function createThrottler<TFn extends AnyFunction, TSelected = {}>(fn: TFn, options: ThrottlerOptions<TFn>, selector?: (state: ThrottlerState<TFn>) => TSelected): SolidThrottler<TFn, TSelected>;
93
+ //#endregion
94
+ export { SolidThrottler, createThrottler };
95
+ //# sourceMappingURL=createThrottler.d.ts.map
@@ -0,0 +1,97 @@
1
+ import { useDefaultPacerOptions } from "../provider/PacerProvider.js";
2
+ import { createEffect, onCleanup } from "solid-js";
3
+ import { useStore } from "@tanstack/solid-store";
4
+ import { Throttler } from "@tanstack/pacer/throttler";
5
+
6
+ //#region src/throttler/createThrottler.ts
7
+ /**
8
+ * A low-level Solid hook that creates a `Throttler` instance that limits how often the provided function can execute.
9
+ *
10
+ * This hook is designed to be flexible and state-management agnostic - it simply returns a throttler instance that
11
+ * you can integrate with any state management solution (createSignal, Redux, Zustand, Jotai, etc). For a simpler and higher-level hook that
12
+ * integrates directly with Solid's createSignal, see createThrottledSignal.
13
+ *
14
+ * Throttling ensures a function executes at most once within a specified time window,
15
+ * regardless of how many times it is called. This is useful for rate-limiting
16
+ * expensive operations or UI updates.
17
+ *
18
+ * ## State Management and Selector
19
+ *
20
+ * The hook uses TanStack Store for reactive state management. The `selector` parameter allows you
21
+ * to specify which state changes will trigger a re-render, optimizing performance by preventing
22
+ * unnecessary re-renders when irrelevant state changes occur.
23
+ *
24
+ * **By default, there will be no reactive state subscriptions** and you must opt-in to state
25
+ * tracking by providing a selector function. This prevents unnecessary re-renders and gives you
26
+ * full control over when your component updates. Only when you provide a selector will the
27
+ * component re-render when the selected state values change.
28
+ *
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
+ * - `executionCount`: Number of function executions that have been completed
33
+ * - `isPending`: Whether the throttler is waiting for the timeout to trigger execution
34
+ * - `lastArgs`: The arguments from the most recent call to maybeExecute
35
+ * - `lastExecutionTime`: Timestamp of the last execution
36
+ * - `nextExecutionTime`: Timestamp of the next allowed execution
37
+ * - `status`: Current execution status ('disabled' | 'idle' | 'pending')
38
+ *
39
+ * @example
40
+ * ```tsx
41
+ * // Default behavior - no reactive state subscriptions
42
+ * const throttler = createThrottler(setValue, { wait: 1000 });
43
+ *
44
+ * // Opt-in to re-render when isPending changes (optimized for loading states)
45
+ * const throttler = createThrottler(
46
+ * setValue,
47
+ * { wait: 1000 },
48
+ * (state) => ({ isPending: state.isPending })
49
+ * );
50
+ *
51
+ * // Opt-in to re-render when executionCount changes (optimized for tracking execution)
52
+ * const throttler = createThrottler(
53
+ * setValue,
54
+ * { wait: 1000 },
55
+ * (state) => ({ executionCount: state.executionCount })
56
+ * );
57
+ *
58
+ * // Multiple state properties - re-render when any of these change
59
+ * const throttler = createThrottler(
60
+ * setValue,
61
+ * {
62
+ * wait: 2000,
63
+ * leading: true, // Execute immediately on first call
64
+ * trailing: false // Skip trailing edge updates
65
+ * },
66
+ * (state) => ({
67
+ * isPending: state.isPending,
68
+ * executionCount: state.executionCount,
69
+ * lastExecutionTime: state.lastExecutionTime,
70
+ * nextExecutionTime: state.nextExecutionTime
71
+ * })
72
+ * );
73
+ *
74
+ * // Access the selected state (will be empty object {} unless selector provided)
75
+ * const { isPending, executionCount } = throttler.state();
76
+ * ```
77
+ */
78
+ function createThrottler(fn, options, selector = () => ({})) {
79
+ const asyncThrottler = new Throttler(fn, {
80
+ ...useDefaultPacerOptions().throttler,
81
+ ...options
82
+ });
83
+ const state = useStore(asyncThrottler.store, selector);
84
+ createEffect(() => {
85
+ onCleanup(() => {
86
+ asyncThrottler.cancel();
87
+ });
88
+ });
89
+ return {
90
+ ...asyncThrottler,
91
+ state
92
+ };
93
+ }
94
+
95
+ //#endregion
96
+ export { createThrottler };
97
+ //# sourceMappingURL=createThrottler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createThrottler.js","names":[],"sources":["../../src/throttler/createThrottler.ts"],"sourcesContent":["import { Throttler } from '@tanstack/pacer/throttler'\nimport { createEffect, onCleanup } from 'solid-js'\nimport { useStore } from '@tanstack/solid-store'\nimport { useDefaultPacerOptions } from '../provider/PacerProvider'\nimport type { Store } from '@tanstack/solid-store'\nimport type { Accessor } from 'solid-js'\nimport type { AnyFunction } from '@tanstack/pacer/types'\nimport type {\n ThrottlerOptions,\n ThrottlerState,\n} from '@tanstack/pacer/throttler'\n\nexport interface SolidThrottler<\n TFn extends AnyFunction,\n TSelected = {},\n> extends Omit<Throttler<TFn>, 'store'> {\n /**\n * Reactive state that will be updated when the throttler state changes\n *\n * Use this instead of `throttler.store.state`\n */\n readonly state: Accessor<Readonly<TSelected>>\n /**\n * @deprecated Use `throttler.state` instead of `throttler.store.state` if you want to read reactive state.\n * The state on the store object is not reactive, as it has not been wrapped in a `useStore` hook internally.\n * Although, you can make the state reactive by using the `useStore` in your own usage.\n */\n readonly store: Store<Readonly<ThrottlerState<TFn>>>\n}\n\n/**\n * A low-level Solid hook that creates a `Throttler` instance that limits how often the provided function can execute.\n *\n * This hook is designed to be flexible and state-management agnostic - it simply returns a throttler instance that\n * you can integrate with any state management solution (createSignal, Redux, Zustand, Jotai, etc). For a simpler and higher-level hook that\n * integrates directly with Solid's createSignal, see createThrottledSignal.\n *\n * Throttling ensures a function executes at most once within a specified time window,\n * regardless of how many times it is called. This is useful for rate-limiting\n * expensive operations or UI updates.\n *\n * ## State Management and Selector\n *\n * The hook uses TanStack Store for reactive state management. The `selector` parameter allows you\n * to specify which state changes will trigger a re-render, optimizing performance by preventing\n * unnecessary re-renders 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 re-renders and gives you\n * full control over when your component updates. Only when you provide a selector will the\n * component re-render when the selected state values change.\n *\n * Available state properties:\n * - `canLeadingExecute`: Whether the throttler can execute on the leading edge\n * - `canTrailingExecute`: Whether the throttler can execute on the trailing edge\n * - `executionCount`: Number of function executions that have been completed\n * - `isPending`: Whether the throttler is waiting for the timeout to trigger execution\n * - `lastArgs`: The arguments from the most recent call to maybeExecute\n * - `lastExecutionTime`: Timestamp of the last execution\n * - `nextExecutionTime`: Timestamp of the next allowed execution\n * - `status`: Current execution status ('disabled' | 'idle' | 'pending')\n *\n * @example\n * ```tsx\n * // Default behavior - no reactive state subscriptions\n * const throttler = createThrottler(setValue, { wait: 1000 });\n *\n * // Opt-in to re-render when isPending changes (optimized for loading states)\n * const throttler = createThrottler(\n * setValue,\n * { wait: 1000 },\n * (state) => ({ isPending: state.isPending })\n * );\n *\n * // Opt-in to re-render when executionCount changes (optimized for tracking execution)\n * const throttler = createThrottler(\n * setValue,\n * { wait: 1000 },\n * (state) => ({ executionCount: state.executionCount })\n * );\n *\n * // Multiple state properties - re-render when any of these change\n * const throttler = createThrottler(\n * setValue,\n * {\n * wait: 2000,\n * leading: true, // Execute immediately on first call\n * trailing: false // Skip trailing edge updates\n * },\n * (state) => ({\n * isPending: state.isPending,\n * executionCount: state.executionCount,\n * lastExecutionTime: state.lastExecutionTime,\n * nextExecutionTime: state.nextExecutionTime\n * })\n * );\n *\n * // Access the selected state (will be empty object {} unless selector provided)\n * const { isPending, executionCount } = throttler.state();\n * ```\n */\nexport function createThrottler<TFn extends AnyFunction, TSelected = {}>(\n fn: TFn,\n options: ThrottlerOptions<TFn>,\n selector: (state: ThrottlerState<TFn>) => TSelected = () => ({}) as TSelected,\n): SolidThrottler<TFn, TSelected> {\n const mergedOptions = {\n ...useDefaultPacerOptions().throttler,\n ...options,\n } as ThrottlerOptions<TFn>\n\n const asyncThrottler = new Throttler<TFn>(fn, mergedOptions)\n\n const state = useStore(asyncThrottler.store, selector)\n\n createEffect(() => {\n onCleanup(() => {\n asyncThrottler.cancel()\n })\n })\n\n return {\n ...asyncThrottler,\n state,\n } as SolidThrottler<TFn, TSelected> // omit `store` in favor of `state`\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqGA,SAAgB,gBACd,IACA,SACA,kBAA6D,EAAE,GAC/B;CAMhC,MAAM,iBAAiB,IAAI,UAAe,IALpB;EACpB,GAAG,wBAAwB,CAAC;EAC5B,GAAG;EACJ,CAE2D;CAE5D,MAAM,QAAQ,SAAS,eAAe,OAAO,SAAS;AAEtD,oBAAmB;AACjB,kBAAgB;AACd,kBAAe,QAAQ;IACvB;GACF;AAEF,QAAO;EACL,GAAG;EACH;EACD"}
@@ -0,0 +1,14 @@
1
+ const require_createThrottler = require('./createThrottler.cjs');
2
+ const require_createThrottledSignal = require('./createThrottledSignal.cjs');
3
+ const require_createThrottledValue = require('./createThrottledValue.cjs');
4
+
5
+ exports.createThrottledSignal = require_createThrottledSignal.createThrottledSignal;
6
+ exports.createThrottledValue = require_createThrottledValue.createThrottledValue;
7
+ exports.createThrottler = require_createThrottler.createThrottler;
8
+ var __tanstack_pacer_throttler = require("@tanstack/pacer/throttler");
9
+ Object.keys(__tanstack_pacer_throttler).forEach(function (k) {
10
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
11
+ enumerable: true,
12
+ get: function () { return __tanstack_pacer_throttler[k]; }
13
+ });
14
+ });
@@ -0,0 +1,5 @@
1
+ import { SolidThrottler, createThrottler } from "./createThrottler.cjs";
2
+ import { createThrottledSignal } from "./createThrottledSignal.cjs";
3
+ import { createThrottledValue } from "./createThrottledValue.cjs";
4
+ export * from "@tanstack/pacer/throttler";
5
+ export { SolidThrottler, createThrottledSignal, createThrottledValue, createThrottler };
@@ -0,0 +1,5 @@
1
+ import { SolidThrottler, createThrottler } from "./createThrottler.js";
2
+ import { createThrottledSignal } from "./createThrottledSignal.js";
3
+ import { createThrottledValue } from "./createThrottledValue.js";
4
+ export * from "@tanstack/pacer/throttler";
5
+ export { SolidThrottler, createThrottledSignal, createThrottledValue, createThrottler };
@@ -1,10 +1,7 @@
1
- export * from "@tanstack/pacer/throttler";
1
+ import { createThrottler } from "./createThrottler.js";
2
2
  import { createThrottledSignal } from "./createThrottledSignal.js";
3
3
  import { createThrottledValue } from "./createThrottledValue.js";
4
- import { createThrottler } from "./createThrottler.js";
5
- export {
6
- createThrottledSignal,
7
- createThrottledValue,
8
- createThrottler
9
- };
10
- //# sourceMappingURL=index.js.map
4
+
5
+ export * from "@tanstack/pacer/throttler"
6
+
7
+ export { createThrottledSignal, createThrottledValue, createThrottler };
@@ -0,0 +1,9 @@
1
+
2
+
3
+ var __tanstack_pacer_types = require("@tanstack/pacer/types");
4
+ Object.keys(__tanstack_pacer_types).forEach(function (k) {
5
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
6
+ enumerable: true,
7
+ get: function () { return __tanstack_pacer_types[k]; }
8
+ });
9
+ });
@@ -0,0 +1 @@
1
+ export * from "@tanstack/pacer/types";
@@ -0,0 +1 @@
1
+ export * from "@tanstack/pacer/types";
@@ -0,0 +1,3 @@
1
+ export * from "@tanstack/pacer/types"
2
+
3
+ export { };
@@ -0,0 +1,9 @@
1
+
2
+
3
+ var __tanstack_pacer_utils = require("@tanstack/pacer/utils");
4
+ Object.keys(__tanstack_pacer_utils).forEach(function (k) {
5
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
6
+ enumerable: true,
7
+ get: function () { return __tanstack_pacer_utils[k]; }
8
+ });
9
+ });
@@ -0,0 +1 @@
1
+ export * from "@tanstack/pacer/utils";
@@ -0,0 +1 @@
1
+ export * from "@tanstack/pacer/utils";
@@ -0,0 +1,3 @@
1
+ export * from "@tanstack/pacer/utils"
2
+
3
+ export { };
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@tanstack/solid-pacer",
3
- "version": "0.15.3",
3
+ "version": "0.16.1",
4
4
  "description": "Utilities for debouncing and throttling functions in Solid.",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "https://github.com/TanStack/pacer.git",
9
+ "url": "git+https://github.com/TanStack/pacer.git",
10
10
  "directory": "packages/solid-pacer"
11
11
  },
12
12
  "homepage": "https://tanstack.com/pacer",
@@ -23,133 +23,65 @@
23
23
  "async"
24
24
  ],
25
25
  "type": "module",
26
- "types": "dist/esm/index.d.ts",
27
- "main": "dist/cjs/index.cjs",
28
- "module": "dist/esm/index.js",
26
+ "main": "./dist/index.cjs",
27
+ "module": "./dist/index.js",
28
+ "types": "./dist/index.d.cts",
29
29
  "exports": {
30
30
  ".": {
31
- "import": {
32
- "types": "./dist/esm/index.d.ts",
33
- "default": "./dist/esm/index.js"
34
- },
35
- "require": {
36
- "types": "./dist/cjs/index.d.cts",
37
- "default": "./dist/cjs/index.cjs"
38
- }
31
+ "require": "./dist/index.cjs",
32
+ "import": "./dist/index.js"
39
33
  },
40
34
  "./async-batcher": {
41
- "import": {
42
- "types": "./dist/esm/async-batcher/index.d.ts",
43
- "default": "./dist/esm/async-batcher/index.js"
44
- },
45
- "require": {
46
- "types": "./dist/cjs/async-batcher/index.d.cts",
47
- "default": "./dist/cjs/async-batcher/index.cjs"
48
- }
35
+ "require": "./dist/async-batcher/index.cjs",
36
+ "import": "./dist/async-batcher/index.js"
49
37
  },
50
38
  "./async-debouncer": {
51
- "import": {
52
- "types": "./dist/esm/async-debouncer/index.d.ts",
53
- "default": "./dist/esm/async-debouncer/index.js"
54
- },
55
- "require": {
56
- "types": "./dist/cjs/async-debouncer/index.d.cts",
57
- "default": "./dist/cjs/async-debouncer/index.cjs"
58
- }
39
+ "require": "./dist/async-debouncer/index.cjs",
40
+ "import": "./dist/async-debouncer/index.js"
59
41
  },
60
42
  "./async-queuer": {
61
- "import": {
62
- "types": "./dist/esm/async-queuer/index.d.ts",
63
- "default": "./dist/esm/async-queuer/index.js"
64
- },
65
- "require": {
66
- "types": "./dist/cjs/async-queuer/index.d.cts",
67
- "default": "./dist/cjs/async-queuer/index.cjs"
68
- }
43
+ "require": "./dist/async-queuer/index.cjs",
44
+ "import": "./dist/async-queuer/index.js"
69
45
  },
70
46
  "./async-rate-limiter": {
71
- "import": {
72
- "types": "./dist/esm/async-rate-limiter/index.d.ts",
73
- "default": "./dist/esm/async-rate-limiter/index.js"
74
- },
75
- "require": {
76
- "types": "./dist/cjs/async-rate-limiter/index.d.cts",
77
- "default": "./dist/cjs/async-rate-limiter/index.cjs"
78
- }
47
+ "require": "./dist/async-rate-limiter/index.cjs",
48
+ "import": "./dist/async-rate-limiter/index.js"
79
49
  },
80
50
  "./async-throttler": {
81
- "import": {
82
- "types": "./dist/esm/async-throttler/index.d.ts",
83
- "default": "./dist/esm/async-throttler/index.js"
84
- },
85
- "require": {
86
- "types": "./dist/cjs/async-throttler/index.d.cts",
87
- "default": "./dist/cjs/async-throttler/index.cjs"
88
- }
51
+ "require": "./dist/async-throttler/index.cjs",
52
+ "import": "./dist/async-throttler/index.js"
89
53
  },
90
54
  "./batcher": {
91
- "import": {
92
- "types": "./dist/esm/batcher/index.d.ts",
93
- "default": "./dist/esm/batcher/index.js"
94
- },
95
- "require": {
96
- "types": "./dist/cjs/batcher/index.d.cts",
97
- "default": "./dist/cjs/batcher/index.cjs"
98
- }
55
+ "require": "./dist/batcher/index.cjs",
56
+ "import": "./dist/batcher/index.js"
99
57
  },
100
58
  "./debouncer": {
101
- "import": {
102
- "types": "./dist/esm/debouncer/index.d.ts",
103
- "default": "./dist/esm/debouncer/index.js"
104
- },
105
- "require": {
106
- "types": "./dist/cjs/debouncer/index.d.cts",
107
- "default": "./dist/cjs/debouncer/index.cjs"
108
- }
59
+ "require": "./dist/debouncer/index.cjs",
60
+ "import": "./dist/debouncer/index.js"
61
+ },
62
+ "./provider": {
63
+ "require": "./dist/provider/index.cjs",
64
+ "import": "./dist/provider/index.js"
109
65
  },
110
66
  "./queuer": {
111
- "import": {
112
- "types": "./dist/esm/queuer/index.d.ts",
113
- "default": "./dist/esm/queuer/index.js"
114
- },
115
- "require": {
116
- "types": "./dist/cjs/queuer/index.d.cts",
117
- "default": "./dist/cjs/queuer/index.cjs"
118
- }
67
+ "require": "./dist/queuer/index.cjs",
68
+ "import": "./dist/queuer/index.js"
119
69
  },
120
70
  "./rate-limiter": {
121
- "import": {
122
- "types": "./dist/esm/rate-limiter/index.d.ts",
123
- "default": "./dist/esm/rate-limiter/index.js"
124
- },
125
- "require": {
126
- "types": "./dist/cjs/rate-limiter/index.d.cts",
127
- "default": "./dist/cjs/rate-limiter/index.cjs"
128
- }
71
+ "require": "./dist/rate-limiter/index.cjs",
72
+ "import": "./dist/rate-limiter/index.js"
129
73
  },
130
74
  "./throttler": {
131
- "import": {
132
- "types": "./dist/esm/throttler/index.d.ts",
133
- "default": "./dist/esm/throttler/index.js"
134
- },
135
- "require": {
136
- "types": "./dist/cjs/throttler/index.d.cts",
137
- "default": "./dist/cjs/throttler/index.cjs"
138
- }
75
+ "require": "./dist/throttler/index.cjs",
76
+ "import": "./dist/throttler/index.js"
139
77
  },
140
78
  "./types": {
141
- "types": "./dist/esm/types/index.d.ts",
142
- "default": "./dist/esm/types/index.js"
79
+ "require": "./dist/types/index.cjs",
80
+ "import": "./dist/types/index.js"
143
81
  },
144
82
  "./utils": {
145
- "import": {
146
- "types": "./dist/esm/utils/index.d.ts",
147
- "default": "./dist/esm/utils/index.js"
148
- },
149
- "require": {
150
- "types": "./dist/cjs/utils/index.d.cts",
151
- "default": "./dist/cjs/utils/index.cjs"
152
- }
83
+ "require": "./dist/utils/index.cjs",
84
+ "import": "./dist/utils/index.js"
153
85
  },
154
86
  "./package.json": "./package.json"
155
87
  },
@@ -163,7 +95,7 @@
163
95
  ],
164
96
  "dependencies": {
165
97
  "@tanstack/solid-store": "^0.8.0",
166
- "@tanstack/pacer": "0.16.3"
98
+ "@tanstack/pacer": "0.16.4"
167
99
  },
168
100
  "devDependencies": {
169
101
  "solid-js": "^1.9.10",
@@ -178,7 +110,6 @@
178
110
  "test:lib": "vitest --passWithNoTests",
179
111
  "test:lib:dev": "pnpm test:lib --watch",
180
112
  "test:types": "tsc",
181
- "test:build": "publint --strict",
182
- "build": "vite build"
113
+ "build": "tsdown"
183
114
  }
184
115
  }