Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace functions

Index

Type aliases

AbstractConstructor<T>: abstract new (...args: any) => T

Type parameters

  • T = any

Type declaration

    • abstract new (...args: any): T
    • Parameters

      • Rest ...args: any

      Returns T

Constructor<T>: new (...args: any) => T

Type parameters

  • T = any

Type declaration

    • new (...args: any): T
    • Parameters

      • Rest ...args: any

      Returns T

Functions

  • debounce<T>(callback: T, delay: number): T
  • The debounced function will ignore all calls to it until the calls have stopped for a specified time period. Only then will it call the original function.

    Debouncing forces a function to wait a certain amount of time before running again. In other words, it limits the rate at which a function gets invoked.

    Type parameters

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

    Parameters

    • callback: T

      The function the debounce.

    • delay: number

      Time in milliseconds

    Returns T

    The debounced function.

  • noop(...args: any[]): void
  • A function that does nothing.

    Parameters

    • Rest ...args: any[]

      Any arguments.

    Returns void

  • throttle<T>(callback: T, delay: number): T
  • To throttle a function means to ensure that the function is called at most once in a specified time period (for instance, once every 10 seconds). This means throttling will prevent a function from running if it has run “recently”.

    Throttling also ensures a function is run regularly at a fixed rate.

    Type parameters

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

    Parameters

    • callback: T

      The function the throttle.

    • delay: number

      Time in milliseconds

    Returns T

    The throttled function.

Generated using TypeDoc