📄 tanstack/pacer/latest/docs/framework/react/reference/functions/useAsyncDebouncedCallback

File: useAsyncDebouncedCallback.md | Updated: 11/15/2025

Source: https://tanstack.com/pacer/latest/docs/framework/react/reference/functions/useAsyncDebouncedCallback



TanStack

Pacer v0v0

Search...

+ K

Auto

Log In

TanStack StartRC

Docs Examples GitHub Contributors

TanStack Router

Docs Examples GitHub Contributors

TanStack Query

Docs Examples GitHub Contributors

TanStack Table

Docs Examples Github Contributors

TanStack Formnew

Docs Examples Github Contributors

TanStack DBbeta

Docs Github Contributors

TanStack Virtual

Docs Examples Github Contributors

TanStack Paceralpha

Docs Examples Github Contributors

TanStack Storealpha

Docs Examples Github Contributors

TanStack Devtoolsalpha

Docs Github Contributors

More Libraries

Maintainers Partners Support Learn StatsBETA Discord Merch Blog GitHub Ethos Brand Guide

Documentation

Framework

React logo

React

Version

Latest

Search...

+ K

Menu

Getting Started

Guides

API Reference

Debouncer API Reference

Throttler API Reference

Rate Limiter API Reference

Queue API Reference

Batcher API Reference

Debouncer Examples

Throttler Examples

Rate Limiter Examples

Queue Examples

Batcher Examples

TanStack Query Examples

Framework

React logo

React

Version

Latest

Menu

Getting Started

Guides

API Reference

Debouncer API Reference

Throttler API Reference

Rate Limiter API Reference

Queue API Reference

Batcher API Reference

Debouncer Examples

Throttler Examples

Rate Limiter Examples

Queue Examples

Batcher Examples

TanStack Query Examples

On this page

useAsyncDebouncedCallback

Copy Markdown

Function: useAsyncDebouncedCallback()
=====================================

ts

function useAsyncDebouncedCallback<TFn>(fn, options): (...args) => Promise<ReturnType<TFn>>;


function useAsyncDebouncedCallback<TFn>(fn, options): (...args) => Promise<ReturnType<TFn>>;

Defined in: react-pacer/src/async-debouncer/useAsyncDebouncedCallback.ts:44

A React hook that creates a debounced version of an async callback function. This hook is a convenient wrapper around the useAsyncDebouncer hook, providing a stable, debounced async function reference for use in React components.

The debounced async function will only execute after the specified wait time has elapsed since its last invocation. If called again before the wait time expires, the timer resets and starts waiting again. The returned function always returns a promise that resolves or rejects with the result of the original async function.

This hook provides a simpler API compared to useAsyncDebouncer, making it ideal for basic async debouncing needs. However, it does not expose the underlying AsyncDebouncer instance.

For advanced usage requiring features like:

  • Manual cancellation
  • Access to execution/error state
  • Custom useCallback dependencies

Consider using the useAsyncDebouncer hook instead.

Type Parameters
---------------
### TFn

TFn extends AnyAsyncFunction

Parameters
----------
### fn

TFn

### options

AsyncDebouncerOptions<TFn>

Returns
-------

ts

(...args): Promise<ReturnType<TFn>>;


(...args): Promise<ReturnType<TFn>>;

### Parameters #### args

...Parameters<TFn>

### Returns

Promise<ReturnType<TFn>>

Example
-------

tsx

// Debounce an async search handler
const handleSearch = useAsyncDebouncedCallback(async (query: string) => {
  const results = await fetchSearchResults(query);
  return results;
}, {
  wait: 500 // Wait 500ms between executions
});

// Use in an input
<input
  type="search"
  onChange={e => handleSearch(e.target.value)}
/>


// Debounce an async search handler
const handleSearch = useAsyncDebouncedCallback(async (query: string) => {
  const results = await fetchSearchResults(query);
  return results;
}, {
  wait: 500 // Wait 500ms between executions
});

// Use in an input
<input
  type="search"
  onChange={e => handleSearch(e.target.value)}
/>

Edit on GitHub

useAsyncDebouncer

ThrottlerOptions

Partners Become a Partner

Code RabbitCode Rabbit CloudflareCloudflare AG GridAG Grid NetlifyNetlify NeonNeon WorkOSWorkOS ClerkClerk ConvexConvex ElectricElectric SentrySentry PrismaPrisma StrapiStrapi UnkeyUnkey

scarf analytics