0.0.9 • Published 17 days ago

@ahmadmubarak98/use-fetch v0.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
17 days ago

@ahmadmubarak98/use-fetch

Introduction

Welcome to @ahmadmubarak98/use-fetch, a lightweight and powerful React hook library designed to simplify fetching data within your React applications. This custom hook leverages the modern React features to make HTTP requests more straightforward and efficient, while also handling cache, loading states and errors gracefully.

Installation

npm install @ahmadmubarak98/use-fetch

Quick Start

import { useFetch } from '@ahmadmubarak98/use-fetch'

function ExampleComponent() {
  const { data, error, isLoading } = useFetch({ url: 'https://dummyjson.com/users/1' })

  if (error) return <div>failed to load</div>
  if (isLoading) return <div>loading...</div>
  return <div>hello {data.name}!</div>
}

License

The MIT License.

0.0.3

17 days ago

0.0.9

17 days ago

0.0.8

17 days ago

0.0.5

17 days ago

0.0.4

17 days ago

0.0.7

17 days ago

0.0.6

17 days ago

0.0.2

19 days ago

0.0.1

20 days ago