debounceSync
Creates a synchronous debounced function that delays invocation until after a specified wait time has elapsed since the last call.
fn
: The synchronous function to debouncedelay
: Debounce delay in milliseconds (default: 500)Returns a debounced function with additional control methods:
cancel()
: Cancel pending executionflush()
: Execute immediatelypending()
: Check if execution is pendingthis
context