UNPKG

@smartinvoicexyz/hooks

Version:

Unified source for React hooks used across the Smart Invoice protocol.

12 lines (11 loc) 354 B
import { fetchFromIPFS } from '@smartinvoicexyz/utils'; import { useQuery } from '@tanstack/react-query'; export const useIpfsDetails = (cid) => { return useQuery({ queryKey: ['ipfsDetails', cid], queryFn: async () => fetchFromIPFS(cid), enabled: !!cid, staleTime: Infinity, refetchInterval: false, }); };