Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
</div>

<div align="center">

### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)

</div>

# TanStack Pacer
Expand Down
18 changes: 9 additions & 9 deletions docs/reference/classes/AsyncDebouncer.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const results = await asyncDebouncer.maybeExecute(inputElement.value);
new AsyncDebouncer<TFn>(fn, initialOptions): AsyncDebouncer<TFn>;
```

Defined in: [async-debouncer.ts:230](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L230)
Defined in: [async-debouncer.ts:229](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L229)

#### Parameters

Expand Down Expand Up @@ -109,7 +109,7 @@ Defined in: [async-debouncer.ts:224](https://github.com/TanStack/pacer/blob/main
fn: TFn;
```

Defined in: [async-debouncer.ts:231](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L231)
Defined in: [async-debouncer.ts:230](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L230)

***

Expand Down Expand Up @@ -149,7 +149,7 @@ Defined in: [async-debouncer.ts:219](https://github.com/TanStack/pacer/blob/main
abort(): void;
```

Defined in: [async-debouncer.ts:469](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L469)
Defined in: [async-debouncer.ts:468](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L468)

Aborts all ongoing executions with the internal abort controllers.
Does NOT cancel any pending execution that have not started yet.
Expand All @@ -166,7 +166,7 @@ Does NOT cancel any pending execution that have not started yet.
cancel(): void;
```

Defined in: [async-debouncer.ts:481](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L481)
Defined in: [async-debouncer.ts:480](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L480)

Cancels any pending execution that have not started yet.
Does NOT abort any execution already in progress.
Expand All @@ -183,7 +183,7 @@ Does NOT abort any execution already in progress.
flush(): Promise<ReturnType<TFn> | undefined>;
```

Defined in: [async-debouncer.ts:404](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L404)
Defined in: [async-debouncer.ts:403](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L403)

Processes the current pending execution immediately

Expand All @@ -199,7 +199,7 @@ Processes the current pending execution immediately
getAbortSignal(maybeExecuteCount?): AbortSignal | null;
```

Defined in: [async-debouncer.ts:459](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L459)
Defined in: [async-debouncer.ts:458](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L458)

Returns the AbortSignal for a specific execution.
If no maybeExecuteCount is provided, returns the signal for the most recent execution.
Expand Down Expand Up @@ -240,7 +240,7 @@ const debouncer = new AsyncDebouncer(
maybeExecute(...args): Promise<ReturnType<TFn> | undefined>;
```

Defined in: [async-debouncer.ts:318](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L318)
Defined in: [async-debouncer.ts:317](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L317)

Attempts to execute the debounced function.
If a call is already in progress, it will be queued.
Expand Down Expand Up @@ -276,7 +276,7 @@ The error from the debounced function if no onError handler is configured
reset(): void;
```

Defined in: [async-debouncer.ts:489](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L489)
Defined in: [async-debouncer.ts:488](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L488)

Resets the debouncer state to its default values

Expand All @@ -292,7 +292,7 @@ Resets the debouncer state to its default values
setOptions(newOptions): void;
```

Defined in: [async-debouncer.ts:258](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L258)
Defined in: [async-debouncer.ts:257](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L257)

Updates the async debouncer options

Expand Down
18 changes: 9 additions & 9 deletions docs/reference/classes/AsyncThrottler.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const result = await throttler.maybeExecute(inputElement.value);
new AsyncThrottler<TFn>(fn, initialOptions): AsyncThrottler<TFn>;
```

Defined in: [async-throttler.ts:242](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-throttler.ts#L242)
Defined in: [async-throttler.ts:241](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-throttler.ts#L241)

#### Parameters

Expand Down Expand Up @@ -113,7 +113,7 @@ Defined in: [async-throttler.ts:236](https://github.com/TanStack/pacer/blob/main
fn: TFn;
```

Defined in: [async-throttler.ts:243](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-throttler.ts#L243)
Defined in: [async-throttler.ts:242](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-throttler.ts#L242)

***

Expand Down Expand Up @@ -153,7 +153,7 @@ Defined in: [async-throttler.ts:231](https://github.com/TanStack/pacer/blob/main
abort(): void;
```

Defined in: [async-throttler.ts:533](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-throttler.ts#L533)
Defined in: [async-throttler.ts:532](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-throttler.ts#L532)

Aborts all ongoing executions with the internal abort controllers.
Does NOT cancel any pending execution that have not started yet.
Expand All @@ -170,7 +170,7 @@ Does NOT cancel any pending execution that have not started yet.
cancel(): void;
```

Defined in: [async-throttler.ts:543](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-throttler.ts#L543)
Defined in: [async-throttler.ts:542](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-throttler.ts#L542)

Cancels any pending execution that have not started yet.
Does NOT abort any execution already in progress.
Expand All @@ -187,7 +187,7 @@ Does NOT abort any execution already in progress.
flush(): Promise<ReturnType<TFn> | undefined>;
```

Defined in: [async-throttler.ts:462](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-throttler.ts#L462)
Defined in: [async-throttler.ts:461](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-throttler.ts#L461)

Processes the current pending execution immediately

Expand All @@ -203,7 +203,7 @@ Processes the current pending execution immediately
getAbortSignal(maybeExecuteCount?): AbortSignal | null;
```

Defined in: [async-throttler.ts:523](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-throttler.ts#L523)
Defined in: [async-throttler.ts:522](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-throttler.ts#L522)

Returns the AbortSignal for a specific execution.
If no maybeExecuteCount is provided, returns the signal for the most recent execution.
Expand Down Expand Up @@ -248,7 +248,7 @@ const throttler = new AsyncThrottler(
maybeExecute(...args): Promise<ReturnType<TFn> | undefined>;
```

Defined in: [async-throttler.ts:338](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-throttler.ts#L338)
Defined in: [async-throttler.ts:337](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-throttler.ts#L337)

Attempts to execute the throttled function. The execution behavior depends on the throttler options:

Expand Down Expand Up @@ -290,7 +290,7 @@ await throttled.maybeExecute('c', 'd');
reset(): void;
```

Defined in: [async-throttler.ts:557](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-throttler.ts#L557)
Defined in: [async-throttler.ts:556](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-throttler.ts#L556)

Resets the debouncer state to its default values

Expand All @@ -306,7 +306,7 @@ Resets the debouncer state to its default values
setOptions(newOptions): void;
```

Defined in: [async-throttler.ts:270](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-throttler.ts#L270)
Defined in: [async-throttler.ts:269](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-throttler.ts#L269)

Updates the async throttler options

Expand Down
2 changes: 1 addition & 1 deletion docs/reference/functions/asyncDebounce.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: asyncDebounce
function asyncDebounce<TFn>(fn, initialOptions): (...args) => Promise<ReturnType<TFn> | undefined>;
```

Defined in: [async-debouncer.ts:559](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L559)
Defined in: [async-debouncer.ts:558](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-debouncer.ts#L558)

Creates an async debounced function that delays execution until after a specified wait time.
The debounced function will only execute once the wait period has elapsed without any new calls.
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/functions/asyncThrottle.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ title: asyncThrottle
function asyncThrottle<TFn>(fn, initialOptions): (...args) => Promise<ReturnType<TFn> | undefined>;
```

Defined in: [async-throttler.ts:627](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-throttler.ts#L627)
Defined in: [async-throttler.ts:626](https://github.com/TanStack/pacer/blob/main/packages/pacer/src/async-throttler.ts#L626)

Creates an async throttled function that limits how often the function can execute.
The throttled function will execute at most once per wait period, even if called multiple times.
Expand Down
3 changes: 2 additions & 1 deletion packages/angular-pacer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
</div>

<div align="center">

### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)

</div>

# TanStack Pacer
Expand Down
3 changes: 1 addition & 2 deletions packages/angular-pacer/src/debouncer/injectDebouncedValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ export function injectDebouncedValue<TValue, TSelected = {}>(
const selector = hasInitialValue
? maybeSelector
: (initialOptionsOrSelector as
| ((state: DebouncerState<Setter<TValue>>) => TSelected)
| undefined)
((state: DebouncerState<Setter<TValue>>) => TSelected) | undefined)

const debounced = injectDebouncedSignal(
initialValue,
Expand Down
6 changes: 2 additions & 4 deletions packages/angular-pacer/src/queuer/injectQueuedValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ export function injectQueuedValue<
value: Signal<TValue>,
initialValueOrOptions?: TValue | QueuerOptions<TValue>,
initialOptionsOrSelector?:
| QueuerOptions<TValue>
| ((state: QueuerState<TValue>) => TSelected),
QueuerOptions<TValue> | ((state: QueuerState<TValue>) => TSelected),
maybeSelector?: (state: QueuerState<TValue>) => TSelected,
): QueuedSignal<TValue, TSelected> {
const hasSelector = typeof initialOptionsOrSelector === 'function'
Expand All @@ -79,8 +78,7 @@ export function injectQueuedValue<
const selector = hasInitialValue
? maybeSelector
: (initialOptionsOrSelector as
| ((state: QueuerState<TValue>) => TSelected)
| undefined)
((state: QueuerState<TValue>) => TSelected) | undefined)

const linkedValue = linkedSignal(() => value())
const queuedValue = signal<TValue>(initialValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ export function injectRateLimitedValue<TValue, TSelected = {}>(
const selector = hasInitialValue
? maybeSelector
: (initialOptionsOrSelector as
| ((state: RateLimiterState) => TSelected)
| undefined)
((state: RateLimiterState) => TSelected) | undefined)

const rateLimited = injectRateLimitedSignal(
initialValue,
Expand Down
3 changes: 1 addition & 2 deletions packages/angular-pacer/src/throttler/injectThrottledValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ export function injectThrottledValue<TValue, TSelected = {}>(
const selector = hasInitialValue
? maybeSelector
: (initialOptionsOrSelector as
| ((state: ThrottlerState<Setter<TValue>>) => TSelected)
| undefined)
((state: ThrottlerState<Setter<TValue>>) => TSelected) | undefined)

const throttledValue = injectThrottledSignal(
initialValue,
Expand Down
3 changes: 2 additions & 1 deletion packages/pacer-devtools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
</div>

<div align="center">

### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)

</div>

# TanStack Pacer
Expand Down
3 changes: 2 additions & 1 deletion packages/pacer-lite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
</div>

<div align="center">

### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)

</div>

# TanStack Pacer
Expand Down
3 changes: 2 additions & 1 deletion packages/pacer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
</div>

<div align="center">

### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)

</div>

# TanStack Pacer
Expand Down
3 changes: 1 addition & 2 deletions packages/pacer/src/async-debouncer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,7 @@ export class AsyncDebouncer<TFn extends AnyAsyncFunction> {
asyncRetryers = new Map<number, AsyncRetryer<TFn>>()
#timeoutId: ReturnType<typeof setTimeout> | null = null
#resolvePreviousPromise:
| ((value?: ReturnType<TFn> | undefined) => void)
| null = null
((value?: ReturnType<TFn> | undefined) => void) | null = null

constructor(
public fn: TFn,
Expand Down
3 changes: 1 addition & 2 deletions packages/pacer/src/async-throttler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,7 @@ export class AsyncThrottler<TFn extends AnyAsyncFunction> {
asyncRetryers = new Map<number, AsyncRetryer<TFn>>()
#timeoutId: ReturnType<typeof setTimeout> | null = null
#resolvePreviousPromise:
| ((value?: ReturnType<TFn> | undefined) => void)
| null = null
((value?: ReturnType<TFn> | undefined) => void) | null = null

constructor(
public fn: TFn,
Expand Down
3 changes: 2 additions & 1 deletion packages/preact-pacer-devtools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
</div>

<div align="center">

### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)

</div>

# TanStack Pacer
Expand Down
3 changes: 2 additions & 1 deletion packages/preact-pacer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
</div>

<div align="center">

### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)

</div>

# TanStack Pacer
Expand Down
3 changes: 2 additions & 1 deletion packages/react-pacer-devtools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
</div>

<div align="center">

### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)

</div>

# TanStack Pacer
Expand Down
3 changes: 2 additions & 1 deletion packages/react-pacer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
</div>

<div align="center">

### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)

</div>

# TanStack Pacer
Expand Down
3 changes: 2 additions & 1 deletion packages/solid-pacer-devtools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
</div>

<div align="center">

### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)

</div>

# TanStack Pacer
Expand Down
3 changes: 2 additions & 1 deletion packages/solid-pacer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
</div>

<div align="center">

### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)

</div>

# TanStack Pacer
Expand Down
Loading
Loading