omnipay-savings-sdk
Version:
Omnipay Savings SDK
34 lines (30 loc) • 851 B
text/typescript
// This file is no longer needed as all components now use React Query directly
// Keeping this file for backward compatibility, but it's recommended to use useQuery from @tanstack/react-query directly
import {useQuery} from '@tanstack/react-query';
/**
* @deprecated Use useQuery from @tanstack/react-query directly instead
*/
export function useLightQuery<T>(
key: string,
fetchFn: () => Promise<T>,
options?: {
staleTime?: number;
enabled?: boolean;
},
) {
const query = useQuery({
queryKey: [key],
queryFn: fetchFn,
staleTime: options?.staleTime || 5000,
enabled: options?.enabled !== false,
});
return {
data: query.data,
error: query.error,
status: query.status,
refetch: query.refetch,
isLoading: query.isLoading,
isSuccess: query.isSuccess,
isError: query.isError,
};
}