Skip to content

fishDev94/usefetch

Repository files navigation

useFetch

Features

Installing

Package manager

Using npm:

$ npm install @fishdeveloper/usefetch

Using yarn:

$ yarn add @fishdeveloper/usefetch

Using pnpm:

$ pnpm add @fishdeveloper/usefetch

Once the package is installed, you can import the library using import approach:

import { useFetch } from "@fishdeveloper/usefetch";

Example

import { useFetch } from "@fishdeveloper/usefetch";

useFetch("todos/1", {
  baseURL: "https://jsonplaceholder.typicode.com",
  headers: { "X-Custom-Header": "foobar" },
}).then((res) => console.log(res));

// output = {
//     data: {
//         "userId": 1,
//         "id": 1,
//         "title": "delectus aut autem",
//         "completed": false
//     }
// }

About

useFetch first npmjs plugin by me

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •