1.0.0 • Published 4 years ago

use-cat-api v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

use-cat-api

React hook to fetch data from the cat-api

NPM JavaScript Style Guide

Install

npm install --save use-cat-api

Usage

import React from 'react'
import { useCatApi } from 'use-cat-api'

const App = () => {
  const {loading, data} = useCatApi()
  if (loading) {
    return (
      <div>
        {loading}
      </div>
    )
  } else {
    return (
      <div>
      {JSON.stringify(data)}
      </div>
    )
  }

}
export default App

License

MIT © berzerk-interactive


This hook is created using create-react-hook.