@tanstack/preact-pacer 0.21.1 → 0.22.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 (107) hide show
  1. package/dist/async-batcher/useAsyncBatchedCallback.cjs.map +1 -1
  2. package/dist/async-batcher/useAsyncBatchedCallback.js.map +1 -1
  3. package/dist/async-batcher/useAsyncBatcher.cjs +2 -2
  4. package/dist/async-batcher/useAsyncBatcher.cjs.map +1 -1
  5. package/dist/async-batcher/useAsyncBatcher.d.cts +2 -2
  6. package/dist/async-batcher/useAsyncBatcher.d.ts +2 -2
  7. package/dist/async-batcher/useAsyncBatcher.js +3 -3
  8. package/dist/async-batcher/useAsyncBatcher.js.map +1 -1
  9. package/dist/async-debouncer/useAsyncDebouncedCallback.cjs.map +1 -1
  10. package/dist/async-debouncer/useAsyncDebouncedCallback.js.map +1 -1
  11. package/dist/async-debouncer/useAsyncDebouncer.cjs +2 -2
  12. package/dist/async-debouncer/useAsyncDebouncer.cjs.map +1 -1
  13. package/dist/async-debouncer/useAsyncDebouncer.d.cts +2 -2
  14. package/dist/async-debouncer/useAsyncDebouncer.d.ts +2 -2
  15. package/dist/async-debouncer/useAsyncDebouncer.js +3 -3
  16. package/dist/async-debouncer/useAsyncDebouncer.js.map +1 -1
  17. package/dist/async-queuer/useAsyncQueuedState.cjs.map +1 -1
  18. package/dist/async-queuer/useAsyncQueuedState.js.map +1 -1
  19. package/dist/async-queuer/useAsyncQueuer.cjs +2 -2
  20. package/dist/async-queuer/useAsyncQueuer.cjs.map +1 -1
  21. package/dist/async-queuer/useAsyncQueuer.d.cts +2 -2
  22. package/dist/async-queuer/useAsyncQueuer.d.ts +2 -2
  23. package/dist/async-queuer/useAsyncQueuer.js +3 -3
  24. package/dist/async-queuer/useAsyncQueuer.js.map +1 -1
  25. package/dist/async-rate-limiter/useAsyncRateLimitedCallback.cjs.map +1 -1
  26. package/dist/async-rate-limiter/useAsyncRateLimitedCallback.js.map +1 -1
  27. package/dist/async-rate-limiter/useAsyncRateLimiter.cjs +2 -2
  28. package/dist/async-rate-limiter/useAsyncRateLimiter.cjs.map +1 -1
  29. package/dist/async-rate-limiter/useAsyncRateLimiter.d.cts +2 -2
  30. package/dist/async-rate-limiter/useAsyncRateLimiter.d.ts +2 -2
  31. package/dist/async-rate-limiter/useAsyncRateLimiter.js +3 -3
  32. package/dist/async-rate-limiter/useAsyncRateLimiter.js.map +1 -1
  33. package/dist/async-throttler/useAsyncThrottledCallback.cjs.map +1 -1
  34. package/dist/async-throttler/useAsyncThrottledCallback.js.map +1 -1
  35. package/dist/async-throttler/useAsyncThrottler.cjs +2 -2
  36. package/dist/async-throttler/useAsyncThrottler.cjs.map +1 -1
  37. package/dist/async-throttler/useAsyncThrottler.d.cts +2 -2
  38. package/dist/async-throttler/useAsyncThrottler.d.ts +2 -2
  39. package/dist/async-throttler/useAsyncThrottler.js +3 -3
  40. package/dist/async-throttler/useAsyncThrottler.js.map +1 -1
  41. package/dist/batcher/useBatchedCallback.cjs.map +1 -1
  42. package/dist/batcher/useBatchedCallback.js.map +1 -1
  43. package/dist/batcher/useBatcher.cjs +2 -2
  44. package/dist/batcher/useBatcher.cjs.map +1 -1
  45. package/dist/batcher/useBatcher.d.cts +2 -2
  46. package/dist/batcher/useBatcher.d.ts +2 -2
  47. package/dist/batcher/useBatcher.js +3 -3
  48. package/dist/batcher/useBatcher.js.map +1 -1
  49. package/dist/debouncer/useDebouncedCallback.cjs.map +1 -1
  50. package/dist/debouncer/useDebouncedCallback.js.map +1 -1
  51. package/dist/debouncer/useDebouncedState.cjs.map +1 -1
  52. package/dist/debouncer/useDebouncedState.js.map +1 -1
  53. package/dist/debouncer/useDebouncedValue.cjs.map +1 -1
  54. package/dist/debouncer/useDebouncedValue.js.map +1 -1
  55. package/dist/debouncer/useDebouncer.cjs +2 -2
  56. package/dist/debouncer/useDebouncer.cjs.map +1 -1
  57. package/dist/debouncer/useDebouncer.d.cts +2 -2
  58. package/dist/debouncer/useDebouncer.d.ts +2 -2
  59. package/dist/debouncer/useDebouncer.js +3 -3
  60. package/dist/debouncer/useDebouncer.js.map +1 -1
  61. package/dist/provider/PacerProvider.cjs.map +1 -1
  62. package/dist/provider/PacerProvider.js.map +1 -1
  63. package/dist/queuer/useQueuedState.cjs.map +1 -1
  64. package/dist/queuer/useQueuedState.js.map +1 -1
  65. package/dist/queuer/useQueuedValue.cjs.map +1 -1
  66. package/dist/queuer/useQueuedValue.js.map +1 -1
  67. package/dist/queuer/useQueuer.cjs +2 -2
  68. package/dist/queuer/useQueuer.cjs.map +1 -1
  69. package/dist/queuer/useQueuer.d.cts +2 -2
  70. package/dist/queuer/useQueuer.d.ts +2 -2
  71. package/dist/queuer/useQueuer.js +3 -3
  72. package/dist/queuer/useQueuer.js.map +1 -1
  73. package/dist/rate-limiter/useRateLimitedCallback.cjs.map +1 -1
  74. package/dist/rate-limiter/useRateLimitedCallback.js.map +1 -1
  75. package/dist/rate-limiter/useRateLimitedState.cjs.map +1 -1
  76. package/dist/rate-limiter/useRateLimitedState.js.map +1 -1
  77. package/dist/rate-limiter/useRateLimitedValue.cjs.map +1 -1
  78. package/dist/rate-limiter/useRateLimitedValue.js.map +1 -1
  79. package/dist/rate-limiter/useRateLimiter.cjs +2 -2
  80. package/dist/rate-limiter/useRateLimiter.cjs.map +1 -1
  81. package/dist/rate-limiter/useRateLimiter.d.cts +2 -2
  82. package/dist/rate-limiter/useRateLimiter.d.ts +2 -2
  83. package/dist/rate-limiter/useRateLimiter.js +3 -3
  84. package/dist/rate-limiter/useRateLimiter.js.map +1 -1
  85. package/dist/throttler/useThrottledCallback.cjs.map +1 -1
  86. package/dist/throttler/useThrottledCallback.js.map +1 -1
  87. package/dist/throttler/useThrottledState.cjs.map +1 -1
  88. package/dist/throttler/useThrottledState.js.map +1 -1
  89. package/dist/throttler/useThrottledValue.cjs.map +1 -1
  90. package/dist/throttler/useThrottledValue.js.map +1 -1
  91. package/dist/throttler/useThrottler.cjs +2 -2
  92. package/dist/throttler/useThrottler.cjs.map +1 -1
  93. package/dist/throttler/useThrottler.d.cts +2 -2
  94. package/dist/throttler/useThrottler.d.ts +2 -2
  95. package/dist/throttler/useThrottler.js +3 -3
  96. package/dist/throttler/useThrottler.js.map +1 -1
  97. package/package.json +5 -5
  98. package/src/async-batcher/useAsyncBatcher.ts +6 -6
  99. package/src/async-debouncer/useAsyncDebouncer.ts +8 -6
  100. package/src/async-queuer/useAsyncQueuer.ts +6 -6
  101. package/src/async-rate-limiter/useAsyncRateLimiter.ts +8 -6
  102. package/src/async-throttler/useAsyncThrottler.ts +8 -6
  103. package/src/batcher/useBatcher.ts +6 -6
  104. package/src/debouncer/useDebouncer.ts +6 -6
  105. package/src/queuer/useQueuer.ts +6 -6
  106. package/src/rate-limiter/useRateLimiter.ts +6 -6
  107. package/src/throttler/useThrottler.ts +6 -6
@@ -1,6 +1,6 @@
1
1
  import { useEffect, useMemo, useState } from 'preact/hooks'
2
2
  import { AsyncThrottler } from '@tanstack/pacer/async-throttler'
3
- import { shallow, useStore } from '@tanstack/preact-store'
3
+ import { shallow, useSelector } from '@tanstack/preact-store'
4
4
  import { useDefaultPacerOptions } from '../provider/PacerProvider'
5
5
  import type { Store } from '@tanstack/preact-store'
6
6
  import type { AnyAsyncFunction } from '@tanstack/pacer/types'
@@ -50,8 +50,8 @@ export interface PreactAsyncThrottler<
50
50
  readonly state: Readonly<TSelected>
51
51
  /**
52
52
  * @deprecated Use `throttler.state` instead of `throttler.store.state` if you want to read reactive state.
53
- * The state on the store object is not reactive, as it has not been wrapped in a `useStore` hook internally.
54
- * Although, you can make the state reactive by using the `useStore` in your own usage.
53
+ * The state on the store object is not reactive, as it has not been wrapped in a `useSelector` hook internally.
54
+ * Although, you can make the state reactive by using the `useSelector` in your own usage.
55
55
  */
56
56
  readonly store: Store<Readonly<AsyncThrottlerState<TFn>>>
57
57
  }
@@ -242,8 +242,8 @@ export function useAsyncThrottler<TFn extends AnyAsyncFunction, TSelected = {}>(
242
242
  selector: (state: AsyncThrottlerState<TFn>) => TSelected
243
243
  children: ((state: TSelected) => ComponentChildren) | ComponentChildren
244
244
  }) {
245
- const selected = useStore(throttlerInstance.store, props.selector, {
246
- equal: shallow,
245
+ const selected = useSelector(throttlerInstance.store, props.selector, {
246
+ compare: shallow,
247
247
  })
248
248
 
249
249
  return typeof props.children === 'function'
@@ -257,7 +257,9 @@ export function useAsyncThrottler<TFn extends AnyAsyncFunction, TSelected = {}>(
257
257
  asyncThrottler.fn = fn
258
258
  asyncThrottler.setOptions(mergedOptions)
259
259
 
260
- const state = useStore(asyncThrottler.store, selector, { equal: shallow })
260
+ const state = useSelector(asyncThrottler.store, selector, {
261
+ compare: shallow,
262
+ })
261
263
 
262
264
  /* eslint-disable react-hooks/exhaustive-deps -- cleanup only; runs on unmount */
263
265
  useEffect(() => {
@@ -1,6 +1,6 @@
1
1
  import { useEffect, useMemo, useState } from 'preact/hooks'
2
2
  import { Batcher } from '@tanstack/pacer/batcher'
3
- import { shallow, useStore } from '@tanstack/preact-store'
3
+ import { shallow, useSelector } from '@tanstack/preact-store'
4
4
  import { useDefaultPacerOptions } from '../provider/PacerProvider'
5
5
  import type { Store } from '@tanstack/preact-store'
6
6
  import type { BatcherOptions, BatcherState } from '@tanstack/pacer/batcher'
@@ -46,8 +46,8 @@ export interface PreactBatcher<TValue, TSelected = {}> extends Omit<
46
46
  readonly state: Readonly<TSelected>
47
47
  /**
48
48
  * @deprecated Use `batcher.state` instead of `batcher.store.state` if you want to read reactive state.
49
- * The state on the store object is not reactive, as it has not been wrapped in a `useStore` hook internally.
50
- * Although, you can make the state reactive by using the `useStore` in your own usage.
49
+ * The state on the store object is not reactive, as it has not been wrapped in a `useSelector` hook internally.
50
+ * Although, you can make the state reactive by using the `useSelector` in your own usage.
51
51
  */
52
52
  readonly store: Store<Readonly<BatcherState<TValue>>>
53
53
  }
@@ -201,8 +201,8 @@ export function useBatcher<TValue, TSelected = {}>(
201
201
  selector: (state: BatcherState<TValue>) => TSelected
202
202
  children: ((state: TSelected) => ComponentChildren) | ComponentChildren
203
203
  }) {
204
- const selected = useStore(batcherInstance.store, props.selector, {
205
- equal: shallow,
204
+ const selected = useSelector(batcherInstance.store, props.selector, {
205
+ compare: shallow,
206
206
  })
207
207
 
208
208
  return typeof props.children === 'function'
@@ -228,7 +228,7 @@ export function useBatcher<TValue, TSelected = {}>(
228
228
  }, [])
229
229
  /* eslint-enable react-hooks/exhaustive-deps */
230
230
 
231
- const state = useStore(batcher.store, selector, { equal: shallow })
231
+ const state = useSelector(batcher.store, selector, { compare: shallow })
232
232
 
233
233
  return useMemo(
234
234
  () =>
@@ -1,6 +1,6 @@
1
1
  import { useEffect, useMemo, useState } from 'preact/hooks'
2
2
  import { Debouncer } from '@tanstack/pacer/debouncer'
3
- import { shallow, useStore } from '@tanstack/preact-store'
3
+ import { shallow, useSelector } from '@tanstack/preact-store'
4
4
  import { useDefaultPacerOptions } from '../provider/PacerProvider'
5
5
  import type { Store } from '@tanstack/preact-store'
6
6
  import type {
@@ -50,8 +50,8 @@ export interface PreactDebouncer<
50
50
  readonly state: Readonly<TSelected>
51
51
  /**
52
52
  * @deprecated Use `debouncer.state` instead of `debouncer.store.state` if you want to read reactive state.
53
- * The state on the store object is not reactive, as it has not been wrapped in a `useStore` hook internally.
54
- * Although, you can make the state reactive by using the `useStore` in your own usage.
53
+ * The state on the store object is not reactive, as it has not been wrapped in a `useSelector` hook internally.
54
+ * Although, you can make the state reactive by using the `useSelector` in your own usage.
55
55
  */
56
56
  readonly store: Store<Readonly<DebouncerState<TFn>>>
57
57
  }
@@ -179,8 +179,8 @@ export function useDebouncer<TFn extends AnyFunction, TSelected = {}>(
179
179
  selector: (state: DebouncerState<TFn>) => TSelected
180
180
  children: ((state: TSelected) => ComponentChildren) | ComponentChildren
181
181
  }) {
182
- const selected = useStore(debouncerInstance.store, props.selector, {
183
- equal: shallow,
182
+ const selected = useSelector(debouncerInstance.store, props.selector, {
183
+ compare: shallow,
184
184
  })
185
185
 
186
186
  return typeof props.children === 'function'
@@ -206,7 +206,7 @@ export function useDebouncer<TFn extends AnyFunction, TSelected = {}>(
206
206
  }, [])
207
207
  /* eslint-enable react-hooks/exhaustive-deps */
208
208
 
209
- const state = useStore(debouncer.store, selector, { equal: shallow })
209
+ const state = useSelector(debouncer.store, selector, { compare: shallow })
210
210
 
211
211
  return useMemo(
212
212
  () =>
@@ -1,6 +1,6 @@
1
1
  import { useEffect, useMemo, useState } from 'preact/hooks'
2
2
  import { Queuer } from '@tanstack/pacer/queuer'
3
- import { shallow, useStore } from '@tanstack/preact-store'
3
+ import { shallow, useSelector } from '@tanstack/preact-store'
4
4
  import { useDefaultPacerOptions } from '../provider/PacerProvider'
5
5
  import type { Store } from '@tanstack/preact-store'
6
6
  import type { QueuerOptions, QueuerState } from '@tanstack/pacer/queuer'
@@ -46,8 +46,8 @@ export interface PreactQueuer<TValue, TSelected = {}> extends Omit<
46
46
  readonly state: Readonly<TSelected>
47
47
  /**
48
48
  * @deprecated Use `queuer.state` instead of `queuer.store.state` if you want to read reactive state.
49
- * The state on the store object is not reactive, as it has not been wrapped in a `useStore` hook internally.
50
- * Although, you can make the state reactive by using the `useStore` in your own usage.
49
+ * The state on the store object is not reactive, as it has not been wrapped in a `useSelector` hook internally.
50
+ * Although, you can make the state reactive by using the `useSelector` in your own usage.
51
51
  */
52
52
  readonly store: Store<Readonly<QueuerState<TValue>>>
53
53
  }
@@ -211,8 +211,8 @@ export function useQueuer<TValue, TSelected = {}>(
211
211
  selector: (state: QueuerState<TValue>) => TSelected
212
212
  children: ((state: TSelected) => ComponentChildren) | ComponentChildren
213
213
  }) {
214
- const selected = useStore(queuerInstance.store, props.selector, {
215
- equal: shallow,
214
+ const selected = useSelector(queuerInstance.store, props.selector, {
215
+ compare: shallow,
216
216
  })
217
217
 
218
218
  return typeof props.children === 'function'
@@ -238,7 +238,7 @@ export function useQueuer<TValue, TSelected = {}>(
238
238
  }, [])
239
239
  /* eslint-enable react-hooks/exhaustive-deps */
240
240
 
241
- const state = useStore(queuer.store, selector, { equal: shallow })
241
+ const state = useSelector(queuer.store, selector, { compare: shallow })
242
242
 
243
243
  return useMemo(
244
244
  () =>
@@ -1,6 +1,6 @@
1
1
  import { useEffect, useMemo, useState } from 'preact/hooks'
2
2
  import { RateLimiter } from '@tanstack/pacer/rate-limiter'
3
- import { shallow, useStore } from '@tanstack/preact-store'
3
+ import { shallow, useSelector } from '@tanstack/preact-store'
4
4
  import { useDefaultPacerOptions } from '../provider/PacerProvider'
5
5
  import type { Store } from '@tanstack/preact-store'
6
6
  import type {
@@ -50,8 +50,8 @@ export interface PreactRateLimiter<
50
50
  readonly state: Readonly<TSelected>
51
51
  /**
52
52
  * @deprecated Use `rateLimiter.state` instead of `rateLimiter.store.state` if you want to read reactive state.
53
- * The state on the store object is not reactive, as it has not been wrapped in a `useStore` hook internally.
54
- * Although, you can make the state reactive by using the `useStore` in your own usage.
53
+ * The state on the store object is not reactive, as it has not been wrapped in a `useSelector` hook internally.
54
+ * Although, you can make the state reactive by using the `useSelector` in your own usage.
55
55
  */
56
56
  readonly store: Store<Readonly<RateLimiterState>>
57
57
  }
@@ -206,8 +206,8 @@ export function useRateLimiter<TFn extends AnyFunction, TSelected = {}>(
206
206
  selector: (state: RateLimiterState) => TSelected
207
207
  children: ((state: TSelected) => ComponentChildren) | ComponentChildren
208
208
  }) {
209
- const selected = useStore(rateLimiterInstance.store, props.selector, {
210
- equal: shallow,
209
+ const selected = useSelector(rateLimiterInstance.store, props.selector, {
210
+ compare: shallow,
211
211
  })
212
212
 
213
213
  return typeof props.children === 'function'
@@ -231,7 +231,7 @@ export function useRateLimiter<TFn extends AnyFunction, TSelected = {}>(
231
231
  }, [])
232
232
  /* eslint-enable react-hooks/exhaustive-deps */
233
233
 
234
- const state = useStore(rateLimiter.store, selector, { equal: shallow })
234
+ const state = useSelector(rateLimiter.store, selector, { compare: shallow })
235
235
 
236
236
  return useMemo(
237
237
  () =>
@@ -1,6 +1,6 @@
1
1
  import { useEffect, useMemo, useState } from 'preact/hooks'
2
2
  import { Throttler } from '@tanstack/pacer/throttler'
3
- import { shallow, useStore } from '@tanstack/preact-store'
3
+ import { shallow, useSelector } from '@tanstack/preact-store'
4
4
  import { useDefaultPacerOptions } from '../provider/PacerProvider'
5
5
  import type { Store } from '@tanstack/preact-store'
6
6
  import type { AnyFunction } from '@tanstack/pacer/types'
@@ -50,8 +50,8 @@ export interface PreactThrottler<
50
50
  readonly state: Readonly<TSelected>
51
51
  /**
52
52
  * @deprecated Use `throttler.state` instead of `throttler.store.state` if you want to read reactive state.
53
- * The state on the store object is not reactive, as it has not been wrapped in a `useStore` hook internally.
54
- * Although, you can make the state reactive by using the `useStore` in your own usage.
53
+ * The state on the store object is not reactive, as it has not been wrapped in a `useSelector` hook internally.
54
+ * Although, you can make the state reactive by using the `useSelector` in your own usage.
55
55
  */
56
56
  readonly store: Store<Readonly<ThrottlerState<TFn>>>
57
57
  }
@@ -184,8 +184,8 @@ export function useThrottler<TFn extends AnyFunction, TSelected = {}>(
184
184
  selector: (state: ThrottlerState<TFn>) => TSelected
185
185
  children: ((state: TSelected) => ComponentChildren) | ComponentChildren
186
186
  }) {
187
- const selected = useStore(throttlerInstance.store, props.selector, {
188
- equal: shallow,
187
+ const selected = useSelector(throttlerInstance.store, props.selector, {
188
+ compare: shallow,
189
189
  })
190
190
 
191
191
  return typeof props.children === 'function'
@@ -199,7 +199,7 @@ export function useThrottler<TFn extends AnyFunction, TSelected = {}>(
199
199
  throttler.fn = fn
200
200
  throttler.setOptions(mergedOptions)
201
201
 
202
- const state = useStore(throttler.store, selector, { equal: shallow })
202
+ const state = useSelector(throttler.store, selector, { compare: shallow })
203
203
 
204
204
  /* eslint-disable react-hooks/exhaustive-deps -- cleanup only; runs on unmount */
205
205
  useEffect(() => {