SShortSingh.
Back to feed

tanstack-fetch: A Typed Fetch Client Designed to Simplify TanStack Query HTTP Layer

0
·60 views

A developer has released tanstack-fetch, an unofficial, typed fetch client built specifically to complement TanStack Query in JavaScript and TypeScript applications. The library addresses common pain points that arise as apps scale, including authentication, typed error handling, request cancellation, retries, and server-sent events. Unlike native fetch, which does not throw on HTTP error status codes like 404 or 500, tanstack-fetch automatically converts HTTP failures into structured FetchError objects that integrate cleanly with TanStack Query's error state. The package can be configured with a base URL, token retrieval logic, and status-specific handlers, reducing repetitive boilerplate across query functions. It requires Node 18 or later in server environments and is available via npm alongside @tanstack/react-query.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Five Ways to Turn Video into GIFs on iPhone in 2026, Compared

A developer-authored comparison evaluates five methods for converting videos or screen recordings into GIFs on iPhone as of late 2026. It weighs watermark policies, maximum frame rates, seamless looping, iMessage integration, and privacy. The author, who builds the MemePouch app, discloses this conflict of interest at the outset. The piece identifies MemePouch as its top pick for iMessage and WhatsApp sticker use, and GIFit as a free option that saves to Photos. It also explains technical constraints such as iMessage's attachment size limits and the difficulty of achieving seamless loops.

0
ProgrammingDEV Community ·

How arrays store data in memory and what each operation costs

An array keeps all its elements in one contiguous memory block of equal-sized items, so the address of any index can be computed directly. Because of this, reading or writing an element by index takes constant time, while searching an unsorted array takes linear time. Inserting or deleting in the middle is costly because later elements must shift to keep the block in order. Dynamic arrays make appends amortised constant time through spare capacity and occasional resizing. The article also notes that a few one-pass array patterns solve many common interview problems.

0
ProgrammingDEV Community ·

Five npm packages reach 7,799 combined downloads, with 232 gained in one day

The developer reported 232 new downloads across five packages in a single day, bringing the combined total to 7,799 toward a 10,000 goal. The most-downloaded package, plumber-linter, gained 171 downloads and reached 2,339 total, while hexlens, environmental-peek, react-dismiss, and @parasraju/plumber-mcp also grew more modestly. Recent releases included plumber-mcp v1.3.0 with a new configuration scanning tool and plumber-linter v1.5.0 with five new GitLab CI rules. The developer noted no shipping activity on the day due to an exam, and plans to release hexlens v0.7.1 the following day.

0
ProgrammingDEV Community ·

Google Releases Gemini 4 Neon, a Mid-Tier Model Aimed at Everyday Developer Coding

Google launched Gemini 4 Neon on November 18, positioning it as the middle tier of its Gemini 4 family, between the frontier Carbon model and the faster Hydrogen model. The model is designed for frequent, complex coding tasks, analytical reasoning, and enterprise workflows. It ranks third on the Artificial Analysis Intelligence Index at maximum thinking and second on the Vals Index, and scored second on the new Agent Arena Index across more than 4,200 real-world agent sessions. Neon offers a 1-million-token context window with multimodal input support. The article argues that its lower cost and latency make it practical for routine developer work, though the claims are drawn from the source's own analysis of pricing and benchmark results.