Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/dtils/deps.ts>asyncUtils.DebouncedFunction

The best unofficial library of utilities for Deno applications
Latest
interface asyncUtils.DebouncedFunction
import { type asyncUtils } from "https://deno.land/x/dtils@2.6.1/deps.ts";
const { DebouncedFunction } = asyncUtils;

A debounced function that will be delayed by a given wait time in milliseconds. If the method is called again before the timeout expires, the previous call will be aborted.

Type Parameters

T extends Array<unknown>

Call Signatures

(...args: T): void

Properties

readonly
pending: boolean

Returns a boolean whether a debounce call is pending or not.

Methods

clear(): void

Clears the debounce timeout and omits calling the debounced function.

flush(): void

Clears the debounce timeout and calls the debounced function immediately.