0.2.4 • Published 6 months ago

@fourcels/fetch v0.2.4

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

fetch advance

Install

npm install @fourcels/fetch

Usage

default fetch

import fetch from "@fourcels/fetch";

const { data } = await fetch.GET("https://dummyjson.com/products", {
  limit: 10,
});
console.log(data);

custom fetch

import { Fetch } from "@fourcels/fetch";

const fetcher = new Fetch("https://dummyjson.com", {
  authFunc(headers) {
    headers.append("Authorization", "Bearer token");
  },
  handleError(res, data) {
    console.log(data);
  },
});
const { data } = await fetcher.POST("/products/add", {
  title: "BMW Pencil",
});
console.log(data);
0.2.4

6 months ago

0.2.3

6 months ago

0.2.2

6 months ago

0.2.1

6 months ago

0.1.2

8 months ago

0.1.1

8 months ago

0.1.0

8 months ago