Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 loading flags 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.error

Each 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

About

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.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages