Function defineDebounceFn

  • DefineDebounceFn is a function that creates a debounced function.

    Parameters

    • fn: CacheResultFunc

      The function to be debounced.

    • Optional delay: number

      The delay in milliseconds to wait before the debounced function is called. Default is 500ms.

    • Optional immediate: boolean

      Whether the debounced function should be called immediately before the delay. Default is false.

    Returns any

    • The debounce function.