@ssamaresh1990/use-star-wars-api

1.0.0 • Public • Published

@ssamaresh1990/use-star-wars-api

A custom react hook that provides Star Wars Data

NPM JavaScript Style Guide

Install

npm install --save @ssamaresh1990/use-star-wars-api

Usage

import React from 'react'
import { useStarWarsAPI } from '@ssamaresh1990/use-star-wars-api'

const App = () => {
  const {data, loading}= useStarWarsAPI()

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

  if(data) {
    return (
      <div>
        {data}
      </div>
    )
  }
  return null;
}

export default App

License

MIT © ssamaresh


This hook is created using create-react-hook.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    15
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    15

Package Sidebar

Install

npm i @ssamaresh1990/use-star-wars-api

Weekly Downloads

15

Version

1.0.0

License

MIT

Unpacked Size

607 kB

Total Files

22

Last publish

Collaborators

  • ssamaresh1990