The function to be debounced.
Optional
delay: numberThe delay in milliseconds to wait before the debounced function is called. Default is 500ms.
Optional
immediate: booleanWhether the debounced function should be called immediately before the delay. Default is false.
DefineDebounceFn is a function that creates a debounced function.