@anuragdaksh7/net-client
v0.1.0
Published
A framework-agnostic request-state API client built on fetch
Maintainers
Readme
Net Client (Request-State API Client)
A framework-agnostic, fetch-based API client that gives you per-request loading, data, and error state — without React Query, Axios, or magic.
Built out of real pain.
Why this exists
Handling API calls is one of the most repetitive and messy parts of building apps.
Most codebases end up with:
- global
loadingflags that break with concurrent requests - Axios responses typed as
any - callbacks everywhere
- hooks doing transport + state + UI
- logic that works in React but not on the server
HTTP clients return Promises.
Apps need request state.
This library separates the two.
Core idea
Instead of this:
await fetch(...)You get this:
request.run()
request.loading
request.data
request.errorEach API call becomes a stateful request controller.
What this library is (and isn’t)
It is
- fetch-based
- Bun / Node / Browser compatible
- framework-agnostic
- per-request state (loading / data / error)
- usable in React and server scripts
- explicit and predictable
It is not
- a React-only library
- a caching framework
- a replacement for React Query
- Axios with a different name
- opinionated about UI or toasts
Architecture
HttpClient → HTTP transport (fetch, headers, errors)
createRequest → per-request state controller
Your app → UI / hooks / logs