use-cat-api

1.0.0 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i use-cat-api

Weekly Downloads

6

Version

1.0.0

License

MIT

Unpacked Size

1.35 MB

Total Files

22

Last publish

Collaborators

  • berzerk