import { computed } from "vue";
import { useAutoRefresh } from "./autoRefresh.js";
export function useModelAutoRefresh(props, deps) {
  const autoRefresh = useAutoRefresh({
    interval: () => props.autoRefresh,
    defaultSeconds: props.autoRefreshDefault,
    reload: deps.reload,
    isLoading: deps.isLoading,
    paused: computed(() => deps.isDialogOpen.value)
  });
  function manualReload() {
    deps.reload();
    autoRefresh.reset();
  }
  return { autoRefresh, manualReload };
}
