the-forest/client/node_modules/@tanstack/react-query/build/modern/usePrefetchQuery.js

12 lines
348 B
JavaScript
Raw Normal View History

2024-09-17 20:35:18 -04:00
// src/usePrefetchQuery.tsx
import { useQueryClient } from "./QueryClientProvider.js";
function usePrefetchQuery(options, queryClient) {
const client = useQueryClient(queryClient);
if (!client.getQueryState(options.queryKey)) {
client.prefetchQuery(options);
}
}
export {
usePrefetchQuery
};
//# sourceMappingURL=usePrefetchQuery.js.map