omnipay-savings-sdk
Version:
Omnipay Savings SDK
28 lines (27 loc) • 1.08 kB
JavaScript
;
// 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
Object.defineProperty(exports, "__esModule", { value: true });
exports.useLightQuery = void 0;
const react_query_1 = require("@tanstack/react-query");
/**
* @deprecated Use useQuery from @tanstack/react-query directly instead
*/
function useLightQuery(key, fetchFn, options) {
const query = (0, react_query_1.useQuery)({
queryKey: [key],
queryFn: fetchFn,
staleTime: (options === null || options === void 0 ? void 0 : options.staleTime) || 5000,
enabled: (options === null || options === void 0 ? void 0 : 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,
};
}
exports.useLightQuery = useLightQuery;