DebouncedFunction

import { DebouncedFunction } from "jsr:@ende/async";

interface

interface DebouncedFunction<T extends Array<unknown>>

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

Call signatures

Call signature

(...args: T): void

Properties

pending

readonly pending: boolean

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

Methods

clear

clear(): void

Clears the debounce timeout and omits calling the debounced function.

flush

flush(): void

Clears the debounce timeout and calls the debounced function immediately.

Source