Skip to content

lib-package/fetch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Async HTTP Request Handler

This repository contains a TypeScript module for handling asynchronous HTTP requests. The module provides a flexible interface for making HTTP requests and managing their responses.

Usage

Installation

You can install via NPM

npx jsr add @jhenbert/fetch

Usage example

import * as mod from "@jhenbert/fetch";

export type Product = {
  name: string;
  price: number;
  image: string;
  type: string;
};

export const getProducts: () => Promise<ServerResponse<Product[], Error>> =
  mod.default<Product[]>(() =>
    fetch(
      "https://mdn.github.io/learning-area/javascript/apis/fetching-data/can-store/products.json"
    )
  );

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published