# @marekdano/use-quote

> a custom React hook that provides a random quote from QuoteGarden

Latest version **1.0.0** (published 2019-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @marekdano/use-quote
pnpm add @marekdano/use-quote
yarn add @marekdano/use-quote
bun add @marekdano/use-quote
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-11-07 |
| First published | 2019-11-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=8 |
| Dependencies | 0 |
| Unpacked size | 123.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | marekdano |
| Maintainers | marekdano |

## Links

- npm: https://www.npmjs.com/package/@marekdano/use-quote
- Repository: https://github.com/marekdano/use-quote
- Homepage: https://github.com/marekdano/use-quote#readme
- Issues: https://github.com/marekdano/use-quote/issues
- npm.io page: https://npm.io/package/@marekdano/use-quote

## Recent versions

- 1.0.0 (latest) — 2019-11-07

## README

# @marekdano/use-quote

> A custom React hook that provides a random quote from QuoteGarden

[![NPM](https://img.shields.io/npm/v/@marekdano/use-quote.svg)](https://www.npmjs.com/package/@marekdano/use-quote) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save @marekdano/use-quote
```
OR

```bash
yarn add @marekdano/use-quote
```

## Usage

```jsx
import React, { Component } from 'react'

import { useQuote } from '@marekdano/use-quote'

const Example = () => {
  const { quote, isLoading, isError } = useQuote()
  
  if (isLoading) return <p>Loading...</p>

  if (quote) {
    return (
      <>
        <p>{quote.text}</p>
        <p><i>{quote.author}</i></p>
      </>
    )
  }

  if (isError) return <p>Difficulty displaying a quote at the moment.</p>

  return null
}
```

## License

MIT © [marekdano](https://github.com/marekdano)

---

This hook is created using [create-react-hook](https://github.com/hermanya/create-react-hook).

---
_Source: https://npm.io/package/@marekdano/use-quote · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
