quarta-feira, 26 de março de 2025
Show HN: I made a fetch client builder to make API calls simpler and safer https://ift.tt/kaLApzY
Show HN: I made a fetch client builder to make API calls simpler and safer I built this library because I kept rewriting the same fetch wrapper for every project. Each time, I needed the same core features: - Make fetch throw errors to integrate smoothly with libraries like TanStack Query - Add sensible defaults to the Fetch API, like a base URL and authentication headers - Validate responses for type safety when OpenAPI isn’t an option I also wanted the library to feel exactly like using fetch — no new API to learn, and no extra friction for my teammates. While there are other great options out there, I found many were either too rigid or too bulky. Doesn’t it feel wrong to ship a 14kb fetch library to the client? To keep up-fetch small and flexible, I took a simple approach: lightweight defaults, paired with inversion of control, so users can easily override what they need. The result? up-fetch weighs just 1.6kb gzipped, with built-in validation (powered by Standard Schema), configurable options, retries, timeouts, streaming & progress tracking, lifecycle hooks, and more. Check it out if you’ve got a minute — I’d love to gather some feedback! https://ift.tt/EX71u3P March 26, 2025 at 09:11AM
Assinar:
Postar comentários (Atom)
DJ Sandro
http://sandroxbox.listen2myradio.com
Nenhum comentário:
Postar um comentário