import { useInsertionEffect, useRef } from "react";
export default function useDepChange(callback, dep) {
    const prevStep = useRef(undefined);
    useInsertionEffect(() => {
        if (prevStep.current)
            callback(prevStep.current);
        return () => {
            prevStep.current = dep;
        };
    }, [dep]);
}
//# sourceMappingURL=useDepChange.js.map