import { onMounted } from "vue"; import { useLiveResource } from "@/stores/session"; import { useTasksStore } from "@/stores/tasks"; /** Owns the initial fetch and the event stream for the page's lifetime. */ export function useDashboard(): void { const store = useTasksStore(); useLiveResource("tasks", () => void store.load(), 500); onMounted(store.load); }