Skip to content
← Dist
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.tsUserApi extends ApiBase, {region} / {id} templates, exhaustive FetchResult.match, two-arm getJson.
  • 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.