Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

362 B
Raw Blame
import type { QueryClient } from "@tanstack/react-query";
import getTask from "@/fetchers/task/get-task";

const PREFETCH_FRESH_MS = 15_000;

export function prefetchTask(queryClient: QueryClient, taskId: string) {
  return queryClient.prefetchQuery({
    queryKey: ["task", taskId],
    queryFn: () => getTask(taskId),
    staleTime: PREFETCH_FRESH_MS,
  });
}