typescript+match-fetchtypescriptmatch-fetch
match-fetch consumer examples
How a TypeScript app uses @danrabydev/match-fetch: UserApi extends ApiBase, exhaustive FetchResult.match, and getJson. EXAMPLE_API_TOKEN is an optional env name; example.com is not a live API.
markdownapp/README.md
match-fetch consumer
How an app uses @danrabydev/match-fetch. Not package internals.
src/api/users.ts—UserApi extends ApiBase,{region}/{id}templates, exhaustiveFetchResult.match, two-armgetJson.src/main.ts— construct the client and match one call.
pnpm add @danrabydev/match-fetch @danrabydev/match
Omit an arm on FetchResult.match and TypeScript errors. EXAMPLE_API_TOKEN is optional; example.com is not a live API.