Repository navigation
Show & Tell: tanstack-fetch — a typed fetch client shaped for queryFn (typed errors, single-flight refresh, SSE with auth) #12510
Unanswered
mohamadgarmabi
asked this question in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi all 👋
I kept writing the same glue around axios / ky / fetch in every TanStack Query project, so I turned it into a small library: tanstack-fetch (MIT, not an official TanStack package).
The goal is to match the
queryFncontract exactly: return data, throw on failure, honor the AbortSignal.What's in it
FetchError(status,body) +isFetchErrorfor narrowingerrorin componentsAuthorizationheader, plus WebSocket / NDJSON streams anduseSse/useWsDocs & live playground: https://mohamadgarmabi.github.io/tanstack-fetch/
I'd really appreciate feedback, especially on whether the API feels natural next to Query, and anything you'd expect a Query-focused fetch client to handle that's missing.
All reactions