@tanstack/solid-pacer 0.20.0 → 0.21.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.
- package/dist/async-batcher/createAsyncBatcher.cjs +2 -2
- package/dist/async-batcher/createAsyncBatcher.cjs.map +1 -1
- package/dist/async-batcher/createAsyncBatcher.d.cts +2 -2
- package/dist/async-batcher/createAsyncBatcher.d.ts +2 -2
- package/dist/async-batcher/createAsyncBatcher.js +3 -3
- package/dist/async-batcher/createAsyncBatcher.js.map +1 -1
- package/dist/async-debouncer/createAsyncDebouncer.cjs +2 -2
- package/dist/async-debouncer/createAsyncDebouncer.cjs.map +1 -1
- package/dist/async-debouncer/createAsyncDebouncer.d.cts +2 -2
- package/dist/async-debouncer/createAsyncDebouncer.d.ts +2 -2
- package/dist/async-debouncer/createAsyncDebouncer.js +3 -3
- package/dist/async-debouncer/createAsyncDebouncer.js.map +1 -1
- package/dist/async-queuer/createAsyncQueuer.cjs +2 -2
- package/dist/async-queuer/createAsyncQueuer.cjs.map +1 -1
- package/dist/async-queuer/createAsyncQueuer.d.cts +2 -2
- package/dist/async-queuer/createAsyncQueuer.d.ts +2 -2
- package/dist/async-queuer/createAsyncQueuer.js +3 -3
- package/dist/async-queuer/createAsyncQueuer.js.map +1 -1
- package/dist/async-rate-limiter/createAsyncRateLimiter.cjs +2 -2
- package/dist/async-rate-limiter/createAsyncRateLimiter.cjs.map +1 -1
- package/dist/async-rate-limiter/createAsyncRateLimiter.d.cts +2 -2
- package/dist/async-rate-limiter/createAsyncRateLimiter.d.ts +2 -2
- package/dist/async-rate-limiter/createAsyncRateLimiter.js +3 -3
- package/dist/async-rate-limiter/createAsyncRateLimiter.js.map +1 -1
- package/dist/async-throttler/createAsyncThrottler.cjs +2 -2
- package/dist/async-throttler/createAsyncThrottler.cjs.map +1 -1
- package/dist/async-throttler/createAsyncThrottler.d.cts +2 -2
- package/dist/async-throttler/createAsyncThrottler.d.ts +2 -2
- package/dist/async-throttler/createAsyncThrottler.js +3 -3
- package/dist/async-throttler/createAsyncThrottler.js.map +1 -1
- package/dist/batcher/createBatcher.cjs +2 -2
- package/dist/batcher/createBatcher.cjs.map +1 -1
- package/dist/batcher/createBatcher.d.cts +2 -2
- package/dist/batcher/createBatcher.d.ts +2 -2
- package/dist/batcher/createBatcher.js +3 -3
- package/dist/batcher/createBatcher.js.map +1 -1
- package/dist/debouncer/createDebouncer.cjs +2 -2
- package/dist/debouncer/createDebouncer.cjs.map +1 -1
- package/dist/debouncer/createDebouncer.d.cts +2 -2
- package/dist/debouncer/createDebouncer.d.ts +2 -2
- package/dist/debouncer/createDebouncer.js +3 -3
- package/dist/debouncer/createDebouncer.js.map +1 -1
- package/dist/queuer/createQueuer.cjs +2 -2
- package/dist/queuer/createQueuer.cjs.map +1 -1
- package/dist/queuer/createQueuer.d.cts +2 -2
- package/dist/queuer/createQueuer.d.ts +2 -2
- package/dist/queuer/createQueuer.js +3 -3
- package/dist/queuer/createQueuer.js.map +1 -1
- package/dist/rate-limiter/createRateLimiter.cjs +2 -2
- package/dist/rate-limiter/createRateLimiter.cjs.map +1 -1
- package/dist/rate-limiter/createRateLimiter.d.cts +2 -2
- package/dist/rate-limiter/createRateLimiter.d.ts +2 -2
- package/dist/rate-limiter/createRateLimiter.js +3 -3
- package/dist/rate-limiter/createRateLimiter.js.map +1 -1
- package/dist/throttler/createThrottler.cjs +2 -2
- package/dist/throttler/createThrottler.cjs.map +1 -1
- package/dist/throttler/createThrottler.d.cts +2 -2
- package/dist/throttler/createThrottler.d.ts +2 -2
- package/dist/throttler/createThrottler.js +3 -3
- package/dist/throttler/createThrottler.js.map +1 -1
- package/package.json +5 -5
- package/src/async-batcher/createAsyncBatcher.ts +7 -5
- package/src/async-debouncer/createAsyncDebouncer.ts +9 -5
- package/src/async-queuer/createAsyncQueuer.ts +7 -5
- package/src/async-rate-limiter/createAsyncRateLimiter.ts +9 -5
- package/src/async-throttler/createAsyncThrottler.ts +9 -5
- package/src/batcher/createBatcher.ts +7 -5
- package/src/debouncer/createDebouncer.ts +9 -5
- package/src/queuer/createQueuer.ts +7 -5
- package/src/rate-limiter/createRateLimiter.ts +7 -5
- package/src/throttler/createThrottler.ts +9 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AsyncRateLimiter } from '@tanstack/pacer/async-rate-limiter'
|
|
2
2
|
import { createEffect, onCleanup } from 'solid-js'
|
|
3
|
-
import {
|
|
3
|
+
import { shallow, useSelector } from '@tanstack/solid-store'
|
|
4
4
|
import { useDefaultPacerOptions } from '../provider/PacerProvider'
|
|
5
5
|
import type { Store } from '@tanstack/solid-store'
|
|
6
6
|
import type { Accessor, JSX } from 'solid-js'
|
|
@@ -50,8 +50,8 @@ export interface SolidAsyncRateLimiter<
|
|
|
50
50
|
readonly state: Accessor<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 `
|
|
54
|
-
* Although, you can make the state reactive by using the `
|
|
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<AsyncRateLimiterState<TFn>>>
|
|
57
57
|
}
|
|
@@ -239,14 +239,18 @@ export function createAsyncRateLimiter<
|
|
|
239
239
|
selector: (state: AsyncRateLimiterState<TFn>) => TSelected
|
|
240
240
|
children: ((state: Accessor<TSelected>) => JSX.Element) | JSX.Element
|
|
241
241
|
}) {
|
|
242
|
-
const selected =
|
|
242
|
+
const selected = useSelector(asyncRateLimiter.store, props.selector, {
|
|
243
|
+
compare: shallow,
|
|
244
|
+
})
|
|
243
245
|
|
|
244
246
|
return typeof props.children === 'function'
|
|
245
247
|
? props.children(selected)
|
|
246
248
|
: props.children
|
|
247
249
|
}
|
|
248
250
|
|
|
249
|
-
const state =
|
|
251
|
+
const state = useSelector(asyncRateLimiter.store, selector, {
|
|
252
|
+
compare: shallow,
|
|
253
|
+
})
|
|
250
254
|
|
|
251
255
|
createEffect(() => {
|
|
252
256
|
onCleanup(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createEffect, onCleanup } from 'solid-js'
|
|
2
2
|
import { AsyncThrottler } from '@tanstack/pacer/async-throttler'
|
|
3
|
-
import {
|
|
3
|
+
import { shallow, useSelector } from '@tanstack/solid-store'
|
|
4
4
|
import { useDefaultPacerOptions } from '../provider/PacerProvider'
|
|
5
5
|
import type { Store } from '@tanstack/solid-store'
|
|
6
6
|
import type { Accessor, JSX } from 'solid-js'
|
|
@@ -50,8 +50,8 @@ export interface SolidAsyncThrottler<
|
|
|
50
50
|
readonly state: Accessor<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 `
|
|
54
|
-
* Although, you can make the state reactive by using the `
|
|
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
|
}
|
|
@@ -194,14 +194,18 @@ export function createAsyncThrottler<
|
|
|
194
194
|
selector: (state: AsyncThrottlerState<TFn>) => TSelected
|
|
195
195
|
children: ((state: Accessor<TSelected>) => JSX.Element) | JSX.Element
|
|
196
196
|
}) {
|
|
197
|
-
const selected =
|
|
197
|
+
const selected = useSelector(asyncThrottler.store, props.selector, {
|
|
198
|
+
compare: shallow,
|
|
199
|
+
})
|
|
198
200
|
|
|
199
201
|
return typeof props.children === 'function'
|
|
200
202
|
? props.children(selected)
|
|
201
203
|
: props.children
|
|
202
204
|
}
|
|
203
205
|
|
|
204
|
-
const state =
|
|
206
|
+
const state = useSelector(asyncThrottler.store, selector, {
|
|
207
|
+
compare: shallow,
|
|
208
|
+
})
|
|
205
209
|
|
|
206
210
|
createEffect(() => {
|
|
207
211
|
onCleanup(() => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Batcher } from '@tanstack/pacer/batcher'
|
|
2
|
-
import {
|
|
2
|
+
import { shallow, useSelector } from '@tanstack/solid-store'
|
|
3
3
|
import { createEffect, onCleanup } from 'solid-js'
|
|
4
4
|
import { useDefaultPacerOptions } from '../provider/PacerProvider'
|
|
5
5
|
import type { Store } from '@tanstack/solid-store'
|
|
@@ -46,8 +46,8 @@ export interface SolidBatcher<TValue, TSelected = {}> extends Omit<
|
|
|
46
46
|
readonly state: Accessor<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 `
|
|
50
|
-
* Although, you can make the state reactive by using the `
|
|
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
|
}
|
|
@@ -171,14 +171,16 @@ export function createBatcher<TValue, TSelected = {}>(
|
|
|
171
171
|
selector: (state: BatcherState<TValue>) => TSelected
|
|
172
172
|
children: ((state: Accessor<TSelected>) => JSX.Element) | JSX.Element
|
|
173
173
|
}) {
|
|
174
|
-
const selected =
|
|
174
|
+
const selected = useSelector(batcher.store, props.selector, {
|
|
175
|
+
compare: shallow,
|
|
176
|
+
})
|
|
175
177
|
|
|
176
178
|
return typeof props.children === 'function'
|
|
177
179
|
? props.children(selected)
|
|
178
180
|
: props.children
|
|
179
181
|
}
|
|
180
182
|
|
|
181
|
-
const state =
|
|
183
|
+
const state = useSelector(batcher.store, selector, { compare: shallow })
|
|
182
184
|
|
|
183
185
|
createEffect(() => {
|
|
184
186
|
onCleanup(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Debouncer } from '@tanstack/pacer/debouncer'
|
|
2
2
|
import { createEffect, onCleanup } from 'solid-js'
|
|
3
|
-
import {
|
|
3
|
+
import { shallow, useSelector } from '@tanstack/solid-store'
|
|
4
4
|
import { useDefaultPacerOptions } from '../provider/PacerProvider'
|
|
5
5
|
import type { Store } from '@tanstack/solid-store'
|
|
6
6
|
import type { Accessor, JSX } from 'solid-js'
|
|
@@ -50,8 +50,8 @@ export interface SolidDebouncer<
|
|
|
50
50
|
readonly state: Accessor<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 `
|
|
54
|
-
* Although, you can make the state reactive by using the `
|
|
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
|
}
|
|
@@ -171,14 +171,18 @@ export function createDebouncer<TFn extends AnyFunction, TSelected = {}>(
|
|
|
171
171
|
selector: (state: DebouncerState<TFn>) => TSelected
|
|
172
172
|
children: ((state: Accessor<TSelected>) => JSX.Element) | JSX.Element
|
|
173
173
|
}) {
|
|
174
|
-
const selected =
|
|
174
|
+
const selected = useSelector(asyncDebouncer.store, props.selector, {
|
|
175
|
+
compare: shallow,
|
|
176
|
+
})
|
|
175
177
|
|
|
176
178
|
return typeof props.children === 'function'
|
|
177
179
|
? props.children(selected)
|
|
178
180
|
: props.children
|
|
179
181
|
}
|
|
180
182
|
|
|
181
|
-
const state =
|
|
183
|
+
const state = useSelector(asyncDebouncer.store, selector, {
|
|
184
|
+
compare: shallow,
|
|
185
|
+
})
|
|
182
186
|
|
|
183
187
|
createEffect(() => {
|
|
184
188
|
onCleanup(() => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Queuer } from '@tanstack/pacer/queuer'
|
|
2
|
-
import {
|
|
2
|
+
import { shallow, useSelector } from '@tanstack/solid-store'
|
|
3
3
|
import { createEffect, onCleanup } from 'solid-js'
|
|
4
4
|
import { useDefaultPacerOptions } from '../provider/PacerProvider'
|
|
5
5
|
import type { Store } from '@tanstack/solid-store'
|
|
@@ -46,8 +46,8 @@ export interface SolidQueuer<TValue, TSelected = {}> extends Omit<
|
|
|
46
46
|
readonly state: Accessor<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 `
|
|
50
|
-
* Although, you can make the state reactive by using the `
|
|
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
|
}
|
|
@@ -171,14 +171,16 @@ export function createQueuer<TValue, TSelected = {}>(
|
|
|
171
171
|
selector: (state: QueuerState<TValue>) => TSelected
|
|
172
172
|
children: ((state: Accessor<TSelected>) => JSX.Element) | JSX.Element
|
|
173
173
|
}) {
|
|
174
|
-
const selected =
|
|
174
|
+
const selected = useSelector(queuer.store, props.selector, {
|
|
175
|
+
compare: shallow,
|
|
176
|
+
})
|
|
175
177
|
|
|
176
178
|
return typeof props.children === 'function'
|
|
177
179
|
? props.children(selected)
|
|
178
180
|
: props.children
|
|
179
181
|
}
|
|
180
182
|
|
|
181
|
-
const state =
|
|
183
|
+
const state = useSelector(queuer.store, selector, { compare: shallow })
|
|
182
184
|
|
|
183
185
|
createEffect(() => {
|
|
184
186
|
onCleanup(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RateLimiter } from '@tanstack/pacer/rate-limiter'
|
|
2
2
|
import { createEffect, onCleanup } from 'solid-js'
|
|
3
|
-
import {
|
|
3
|
+
import { shallow, useSelector } from '@tanstack/solid-store'
|
|
4
4
|
import { useDefaultPacerOptions } from '../provider/PacerProvider'
|
|
5
5
|
import type { Store } from '@tanstack/solid-store'
|
|
6
6
|
import type { Accessor, JSX } from 'solid-js'
|
|
@@ -50,8 +50,8 @@ export interface SolidRateLimiter<
|
|
|
50
50
|
readonly state: Accessor<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 `
|
|
54
|
-
* Although, you can make the state reactive by using the `
|
|
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
|
}
|
|
@@ -200,14 +200,16 @@ export function createRateLimiter<TFn extends AnyFunction, TSelected = {}>(
|
|
|
200
200
|
selector: (state: RateLimiterState) => TSelected
|
|
201
201
|
children: ((state: Accessor<TSelected>) => JSX.Element) | JSX.Element
|
|
202
202
|
}) {
|
|
203
|
-
const selected =
|
|
203
|
+
const selected = useSelector(rateLimiter.store, props.selector, {
|
|
204
|
+
compare: shallow,
|
|
205
|
+
})
|
|
204
206
|
|
|
205
207
|
return typeof props.children === 'function'
|
|
206
208
|
? props.children(selected)
|
|
207
209
|
: props.children
|
|
208
210
|
}
|
|
209
211
|
|
|
210
|
-
const state =
|
|
212
|
+
const state = useSelector(rateLimiter.store, selector, { compare: shallow })
|
|
211
213
|
|
|
212
214
|
createEffect(() => {
|
|
213
215
|
onCleanup(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Throttler } from '@tanstack/pacer/throttler'
|
|
2
2
|
import { createEffect, onCleanup } from 'solid-js'
|
|
3
|
-
import {
|
|
3
|
+
import { shallow, useSelector } from '@tanstack/solid-store'
|
|
4
4
|
import { useDefaultPacerOptions } from '../provider/PacerProvider'
|
|
5
5
|
import type { Store } from '@tanstack/solid-store'
|
|
6
6
|
import type { Accessor, JSX } from 'solid-js'
|
|
@@ -50,8 +50,8 @@ export interface SolidThrottler<
|
|
|
50
50
|
readonly state: Accessor<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 `
|
|
54
|
-
* Although, you can make the state reactive by using the `
|
|
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
|
}
|
|
@@ -174,14 +174,18 @@ export function createThrottler<TFn extends AnyFunction, TSelected = {}>(
|
|
|
174
174
|
selector: (state: ThrottlerState<TFn>) => TSelected
|
|
175
175
|
children: ((state: Accessor<TSelected>) => JSX.Element) | JSX.Element
|
|
176
176
|
}) {
|
|
177
|
-
const selected =
|
|
177
|
+
const selected = useSelector(asyncThrottler.store, props.selector, {
|
|
178
|
+
compare: shallow,
|
|
179
|
+
})
|
|
178
180
|
|
|
179
181
|
return typeof props.children === 'function'
|
|
180
182
|
? props.children(selected)
|
|
181
183
|
: props.children
|
|
182
184
|
}
|
|
183
185
|
|
|
184
|
-
const state =
|
|
186
|
+
const state = useSelector(asyncThrottler.store, selector, {
|
|
187
|
+
compare: shallow,
|
|
188
|
+
})
|
|
185
189
|
|
|
186
190
|
createEffect(() => {
|
|
187
191
|
onCleanup(() => {
|