import { useRef, useMemo } from 'react';
export function useLazy(init, deps) {
    var valueRef = useRef(null);
    return useMemo(function () {
        valueRef.current = null;
        return function () {
            if (!valueRef.current) {
                valueRef.current = init();
            }
            return valueRef.current;
        };
    }, deps);
}
