Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

  • T: (...args: any[]) => any

Hierarchy

  • DebouncedFunc

Callable

  • DebouncedFunc(...args: Parameters<T>): undefined | ReturnType<T>
  • Call the original function, but applying the debounce rules.

    If the debounced function can be run immediately, this calls it and returns its return value.

    Otherwise, it returns the return value of the last invocation, or undefined if the debounced function was not invoked yet.

    Parameters

    • Rest ...args: Parameters<T>

    Returns undefined | ReturnType<T>

Index

Methods

cancel

  • cancel(): void
  • Throw away any pending invocation of the debounced function.

    Returns void

flush

  • flush(): undefined | ReturnType<T>
  • If there is a pending invocation of the debounced function, invoke it immediately and return its return value.

    Otherwise, return the value from the last invocation, or undefined if the debounced function was never invoked.

    Returns undefined | ReturnType<T>

Generated using TypeDoc