fetch-qwery
v1.1.1
Published
The high-performance, lightweight data fetching solution for React and Next.js. Features intelligent caching, SWR, race-condition protection, and flicker-free UI updates.
Downloads
318
Maintainers
Readme
🚀 Fetch-Qwery
The Zero-Config, Ultra-Performance React Calling Engine.
Fetch-Qwery is an insanely fast, minimal React hook explicitly designed to completely bypass setup boilerplate, maximize rendering speed edge-to-edge, and eliminate Next.js/Vite hydration flickers. It operates out of the box with intelligent caching, automatic smart-prefetching, and universal platform hydration.
🔥 Key Directives
- Zero Configuration: Simply
import { useFetch } from 'fetch-qwery'. No Providers, no setup needed. Fast iteration from day one. - Micro Bundle: Hand-optimized to guarantee minimal footprint overhead on your JS budgets. Production-ready tree-shaking included (
tsup). - Lighthouse 100/100 Optimizer: Next.js and Vercel edge-ready network-aware prefetching. Built-in network inspection avoids data-drain on slow hardware.
- Universal Localhost Speed: Intelligently skips stale-revalidation flickers during Dev mode to keep you coding fast, then zeroes it out securely for strict Production compliance.
- React 18 & 19 Ready: Full internal strict concurrency, avoiding all
useEffectcascading re-renders. Immediate data availability on cached hits.
📦 Installation
npm install fetch-qwery
# or
pnpm add fetch-qwery⚡ Usage
import { useFetch } from "fetch-qwery";
function ProductList() {
const { data: products, loading } = useFetch("https://dummyjson.com/products", {
select: (res) => res.products
});
if (loading) return <div>Loading Products...</div>;
return (
<div className="grid grid-cols-3 gap-4">
{products?.map(product => (
<div key={product.id} className="card">
<img src={product.thumbnail} alt={product.title} />
<h3>{product.title}</h3>
</div>
))}
</div>
);
}🛠️ Advanced Options
Fetch-qwery fully supports complex API flows including parallel fetches, method overloads, and strict typing.
const { data } = useFetch([
"https://dummyjson.com/users/1",
"https://dummyjson.com/products/1"
], {
staleTime: 60000,
baseUrl: "https://dummyjson.com",
preloadImages: true,
autoPrefetch: true
});
// data[0] is User, data[1] is Product