
@tahanabavi/typefetch-react
The React adapter for @tahanabavi/typefetch-query-core: useQuery, useMutation, and a provider. Deliberately thin — each hook hands the core's subscribe / getSnapshot contract to useSyncExternalStore, so all caching, staleness, and invalidation stay in the core.
Overview
A thin React binding over the query-core engine.
typefetch-react is the React binding for the query-core engine. It ships exactly three things — useQuery, useMutation, and TypeFetchProvider — and nothing more. The engine already exposes subscribe / getSnapshot, so each hook is simply that contract handed to React's useSyncExternalStore.
Because caching, staleness, and invalidation all live in the core, the adapter stays deliberately thin. React >=18 is a peer dependency (the hooks rely on useSyncExternalStore), and @tahanabavi/typefetch-query-core is re-exported, so a QueryClient needs no second direct dependency.
Like the core, the hooks take an endpoint and its input — no cache key and no query function. The engine derives the key from the contract's own stable id.