Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "src/helpers/debounce"

Index

Functions

Const debounce

  • debounce(event: MouseEvent<HTMLElement>, context: DebounceContext, debounceTimeout?: number): boolean
  • A function used to debounce clicks occuring close together (that is, double clicks) if the attribute data-prevent-double-click is set to "true".

    If debouncing is appropriate, this function calls event.preventDefault() automatically.

    Parameters

    • event: MouseEvent<HTMLElement>

      The click event to possible debounce.

    • context: DebounceContext

      An instance of DebounceContext, persisted between debounce calls for the same element.

    • Default value debounceTimeout: number = 1000

      The time between click to consider a double click in milliseconds. Defaults to 1000.

    Returns boolean

    true if the click should be debounced, otherwise false.

Const makeDebounceContext

Generated using TypeDoc