@arturonavarro/use-star-wars-quote

npm install --save @arturonavarro/use-star-wars-quote

Usage no npm install needed!

<script type="module">
  import arturonavarroUseStarWarsQuote from 'https://cdn.skypack.dev/@arturonavarro/use-star-wars-quote';
</script>

README

@arturonavarro/use-star-wars-quote

NPM JavaScript Style Guide

Install

npm install --save @arturonavarro/use-star-wars-quote

Usage

import React from 'react'
import { useStarWarsQuote } from '@arturonavarro/use-star-wars-quote'

const Example = () => {
   const { quote, loading } = useStarWarsQuote();

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

   if (quote) {
      return (
         <h1>
            {quote}
         </h1>
      );
   }

   return null;
}

License

MIT © Arturo


This hook is created using create-react-hook.