@damengrandom/use-fetch-hook-trial

2.0.1 • Public • Published

@damengrandom/use-fetch-hook-trial

a trial for creating a custom fetch hook

NPM JavaScript Style Guide

Install

npm install --save @damengrandom/use-fetch-hook-trial

Usage

import React from 'react'
import { useFetchQuote } from '@damengrandom/use-fetch-hook-trial'

const App = () => {
  const endpoint = 'https://jsonplaceholder.typicode.com/todos/1'
  const { quote, loading } = useFetchQuote(endpoint)

  if (loading) return <p>Loading ..</p>

  return (
    <div>
      <p><quote>{quote}</quote></p>
    </div>
  )
}
export default App

License

MIT © DamengRandom


This hook is created using create-react-hook.

Readme

Keywords

none

Package Sidebar

Install

npm i @damengrandom/use-fetch-hook-trial

Weekly Downloads

21

Version

2.0.1

License

MIT

Unpacked Size

604 kB

Total Files

22

Last publish

Collaborators

  • damengrandom