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.

540 B
Raw Blame
import { useQueryClient } from "@tanstack/react-query";
import { useCallback } from "react";

function useGetCachedCustomFieldValues() {
  const queryClient = useQueryClient();

  const getValuesForTask = useCallback(
    (taskId: string) => {
      return (
        (queryClient.getQueryData(["custom-field-values", taskId]) as
          | Array<{ fieldId: string; value: string | null }>
          | undefined) ?? []
      );
    },
    [queryClient],
  );

  return { getValuesForTask };
}

export default useGetCachedCustomFieldValues;