'use client';
import { useEffect, useState } from 'react';
export function useDebouncedEffect(effect, deps, delay) {
    const [debouncedEffect, setDebouncedEffect] = useState(()=>effect);
    useEffect(()=>{
        const handler = setTimeout(()=>{
            setDebouncedEffect(()=>effect);
        }, delay);
        return ()=>{
            clearTimeout(handler);
        };
    }, [
        ...deps,
        delay
    ]);
    useEffect(()=>{
        debouncedEffect();
    }, [
        debouncedEffect
    ]);
}

//# sourceMappingURL=useDebouncedEffect.js.map