Skip to main content

Command Palette

Search for a command to run...

tanstack-fetch 1.7.0 — Solid, Angular, Svelte adapters + doctor CLI

Updated
•2 min read•View as Markdown

If you use TanStack Query, your queryFn already wants three things:

  1. Return data (not a Response wrapper)

  2. Throw on failure (so isError / error work)

  3. Honor AbortSignal

tanstack-fetch is shaped for that model. In 1.7.0 it ships real adapters for Solid, Angular, and Svelte — plus doctor, migrate scaffolds, onDownloadProgress, and a docs Framework picker.

Not an official TanStack package — shaped for the same Query API.

Upgrade

npm install tanstack-fetch@1.7.0

Adapters

Import API
tanstack-fetch/solid FetchProvider, useFetch, useSse
tanstack-fetch/svelte setFetchClient, useFetch, useSse
tanstack-fetch/angular provideFetchClient, injectFetch, useSse
import { createFetch } from 'tanstack-fetch/sse'
import { useSse } from 'tanstack-fetch/solid'

const api = createFetch({ plugins: ['sse-resume'] })
const { data, status, close } = useSse('/orders/stream', { client: api })

Doctor + migrate

npx tanstack-fetch doctor --dir ./src
npx tanstack-fetch migrate --from axios --framework solid --write
npx tanstack-fetch migrate --from fetch --framework angular --write
npx tanstack-fetch migrate --from fetch --framework sveltekit --write

Download progress

await api.get('/files/report.pdf', {
  parseAs: 'blob',
  onDownloadProgress: ({ progress, loaded, total }) => console.log(progress, loaded, total),
})