import { Duration } from 'luxon';
import { useCallback, useEffect } from 'react';
const defaultDelay = Duration.fromObject({ minutes: 1 }).as('milliseconds');
export function useInterval(callback, delay = defaultDelay) {
    const update = useCallback(() => {
        callback();
    }, [callback]);
    useEffect(() => {
        const timer = globalThis.setInterval(update, delay);
        return () => {
            globalThis.clearInterval(timer);
        };
    }, [update, delay]);
}
//# sourceMappingURL=use-interval.js.map